diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-18 10:45:07 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-18 10:45:07 +0200 |
commit | db7702213c195e74e8a42dcef23eff9cadb3202e (patch) | |
tree | 588683dee40d8b42c59d9b1a2e70b344a22fc803 /ext/pcre/tests | |
parent | 996292a91d40c2fa9221bb9899e7a9b5cd7ebed2 (diff) | |
parent | e11ed028706dbedc51ba71736de21db15890a1c0 (diff) | |
download | php-git-db7702213c195e74e8a42dcef23eff9cadb3202e.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r-- | ext/pcre/tests/bug78272.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug78272.phpt b/ext/pcre/tests/bug78272.phpt new file mode 100644 index 0000000000..576d3013a5 --- /dev/null +++ b/ext/pcre/tests/bug78272.phpt @@ -0,0 +1,33 @@ +--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 { + print "Main start\n"; + pcntl_waitpid($pid, $status); + print "End Main\n"; + exit(0); +} +?> +--EXPECT-- +Main start +Child start +Array +( + [0] => abc +) +End child +End Main |