PHP:如何检测子进程错误vesus正常退出?

When a child process errors out such as PHP error/warning/notice, is there a way to tell from the parent process? I try the following code but it returns exit normally.

<?php

$pid = pcntl_fork();
if ($pid > 0)
{
    echo "pid: $pid
";
    $status = 0;
    pcntl_waitpid($pid, $status);
    if (pcntl_wifsignaled($status))
        echo "child crashed
";
    if (pcntl_wifexited($status))
        echo "child exited normally
";
    if (pcntl_wifstopped($status))
        echo "child stopped
";
}
else if ($pid == 0)
{
    $n = 0;
    while (++$n < 10)
    {
        echo ".";
        sleep(1);
        if ($n == 8)
        {
            // to cause a crash
            //   $n = $n / 0;
            $a = "a";
            unserialize(str_replace('1', 2147483647, serialize($a)));
        }
    }
}
?>