6.11.0
Catch PHP errors and log it in Process and ProcessByName interrupters.
set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline) use ($logger) : void {
if (! (error_reporting() & $errno)) {
// error_reporting does not include this error
return;
}
$exception = new ErrorException($errstr, 0, $errno, $errfile, $errline);
// Maybe in next releases we will throw this exceptions
$logger->error('When execute process, catch PHP error. But not throwing it.', [
'exception' => $exception
]);
});