xref: /PHP-8.2/ext/pcntl/tests/bug73783.phpt (revision 74859783)
1--TEST--
2Bug #73783: (SIG_IGN needs to be set to prevent syscals from returning early)
3--EXTENSIONS--
4pcntl
5posix
6--FILE--
7<?php
8pcntl_signal(SIGCHLD, SIG_IGN);
9
10switch(pcntl_fork()) {
11    case 0:
12        exit;
13        break;
14}
15
16$before = microtime(true);
17sleep(1);
18
19if (microtime(true) - $before >= 0.8) {
20    echo "working\n";
21} else {
22    echo "failed\n";
23}
24?>
25--EXPECT--
26working
27