ru_php/ext/pcntl/tests/async_signals_2.phpt

31 lines
477 B
PHP

--TEST--
Async signals in zend_call_function
--EXTENSIONS--
pcntl
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
--FILE--
<?php
pcntl_async_signals(true);
pcntl_signal(SIGALRM, function($signo) {
throw new Exception("Alarm!");
});
pcntl_alarm(1);
try {
array_map(
'time_nanosleep',
array_fill(0, 360, 1),
array_fill(0, 360, 0)
);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Alarm!