xref: /PHP-8.0/ext/pcntl/tests/bug81577_2.phpt (revision fa0b84a0)
1--TEST--
2Bug #81577: (Exceptions in interrupt handlers: ADD_ARRAY_ELEMENT)
3--SKIPIF--
4<?php
5if (!extension_loaded("pcntl")) print "skip pcntl extension not available";
6elseif (!extension_loaded('posix')) die('skip posix extension not available');
7?>
8--FILE--
9<?php
10pcntl_async_signals(true);
11pcntl_signal(SIGTERM, function ($signo) {});
12try {
13	$a = [1, posix_kill(posix_getpid(), SIGTERM), 2];
14} catch (Throwable $ex) {
15	echo get_class($ex) , " : " , $ex->getMessage() , "\n";
16}
17var_dump($a);
18?>
19--EXPECT--
20array(3) {
21  [0]=>
22  int(1)
23  [1]=>
24  bool(true)
25  [2]=>
26  int(2)
27}
28