1--TEST--
2Async signals in zend_call_function
3--EXTENSIONS--
4pcntl
5--SKIPIF--
6<?php
7if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
8?>
9--FILE--
10<?php
11
12pcntl_async_signals(1);
13pcntl_signal(SIGALRM, function($signo) {
14    throw new Exception("Alarm!");
15});
16
17pcntl_alarm(1);
18try {
19    array_map(
20        'time_nanosleep',
21        array_fill(0, 360, 1),
22        array_fill(0, 360, 0)
23    );
24} catch (Exception $e) {
25    echo $e->getMessage(), "\n";
26}
27
28?>
29--EXPECT--
30Alarm!
31