1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Files
archived-php-src/ext/pcntl/tests/bug73783.phpt
T
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

29 lines
532 B
PHP

--TEST--
Bug #73783: (SIG_IGN needs to be set to prevent syscals from returning early)
--SKIPIF--
<?php
if (!extension_loaded('pcntl')) die('skip pcntl extension not available');
elseif (!extension_loaded('posix')) die('skip posix extension not available');
?>
--FILE--
<?php
pcntl_signal(SIGCHLD, SIG_IGN);
switch(pcntl_fork()) {
case 0:
exit;
break;
}
$before = microtime(true);
sleep(1);
if (microtime(true) - $before >= 0.8) {
echo "working\n";
} else {
echo "failed\n";
}
?>
--EXPECT--
working