summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug78272.phpt
blob: bab29245230b37f8f734ef6daf977b1a3bf18de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
Bug #78272: calling preg_match() before pcntl_fork() will freeze child process
--SKIPIF--
<?php
if (!extension_loaded('pcntl')) die("skip pcntl extension required");
?>
--FILE--
<?php
preg_match('/abc/', 'abcde', $r);

$pid = pcntl_fork();
if ($pid === 0) {
    print "Child start\n";
    preg_match('/abc/', 'abcde', $r);
    print_r($r);
    print "End child\n";
    exit(0);
} else {
    pcntl_waitpid($pid, $status);
    print "End Main\n";
    exit(0);
}
?>
--EXPECT--
Child start
Array
(
    [0] => abc
)
End child
End Main