xref: /PHP-8.3/ext/pcntl/tests/pcntl_alarm.phpt (revision 6600ad60)
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();
17var_dump(pcntl_sigtimedwait(array(SIGALRM),$siginfo,2) === SIGALRM);
18?>
19--EXPECT--
20int(0)
21bool(true)
22bool(true)
23