Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #78272: calling preg_match() before pcntl_fork() will freeze child process --..

Decoded Output download

--TEST--
Bug #78272: calling preg_match() before pcntl_fork() will freeze child process
--EXTENSIONS--
pcntl
--FILE--
<?php
preg_match('/abc/', 'abcde', $r);

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

Did this file decode correctly?

Original Code

--TEST--
Bug #78272: calling preg_match() before pcntl_fork() will freeze child process
--EXTENSIONS--
pcntl
--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

Function Calls

pcntl_fork 1
preg_match 1

Variables

None

Stats

MD5 85a6119615b287ffcfabd76eea133fdd
Eval Count 0
Decode Time 115 ms