protected function registerChildShutdown()
    {
        $ipc = $this->ipc;

        register_shutdown_function(function () use ($ipc) {
            $error = error_get_last();
            if ($error && isset($error['type']) && in_array($error['type'], array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR))) {
                $ipc->put(new ExceptionDataHolder(
                    new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'])
                ));
            }
        });

        register_shutdown_function(function () {
            posix_kill(getmypid(), SIGKILL);
        });
    }