xref: /PHP-5.6/ext/pcntl/tests/pcntl_alarm.phpt (revision 41201c78)
1--TEST--
2pcntl_alarm()
3--SKIPIF--
4<?php if (!function_exists("pcntl_sigtimedwait")) die("skip pcntl_sigtimedwait() not available"); ?>
5--INI--
6max_execution_time=0
7--FILE--
8<?php
9pcntl_signal(SIGALRM, function(){});
10
11var_dump(pcntl_alarm());
12pcntl_alarm(0);
13var_dump(pcntl_alarm(60));
14var_dump(pcntl_alarm(1) > 0);
15$siginfo = array();
16var_dump(pcntl_sigtimedwait(array(SIGALRM),$siginfo,2) === SIGALRM);
17?>
18--EXPECTF--
19Warning: pcntl_alarm() expects exactly 1 parameter, 0 given in %s
20NULL
21int(0)
22bool(true)
23bool(true)
24