xref: /php-src/ext/pcntl/tests/pcntl_alarm.phpt (revision 1bdb0fdd)
1--TEST--
2pcntl_alarm()
3--EXTENSIONS--
4pcntl
5--SKIPIF--
6<?php if (!function_exists("pcntl_sigtimedwait")) die("skip pcntl_sigtimedwait() not available"); ?>
7--INI--
8max_execution_time=0
9--FILE--
10<?php
11pcntl_signal(SIGALRM, function(){});
12
13pcntl_alarm(0);
14var_dump(pcntl_alarm(60));
15var_dump(pcntl_alarm(1) > 0);
16$siginfo = array();
17$signo = pcntl_sigtimedwait(array(SIGALRM),$siginfo,2);
18var_dump($signo === SIGALRM);
19?>
20--EXPECT--
21int(0)
22bool(true)
23bool(true)
24