$handler =
$prev[0
];
} elseif ($handler !==
$prev[0
] &&
$replace) { set_exception_handler([$handler, 'handleException'
]);
$p =
$prev[0
]->
setExceptionHandler(null
);
$handler->
setExceptionHandler($p);
$prev[0
]->
setExceptionHandler($p);
} } else { $handler->
setExceptionHandler($prev ??
[$handler, 'renderException'
]);
} $handler->
throwAt(\E_ALL &
$handler->thrownErrors, true
);
return $handler;
} /**
* Calls a function and turns any PHP error into \ErrorException.
*
* @throws \ErrorException When $function(...$arguments) triggers a PHP error
*/
public static function call(callable
$function, mixed ...
$arguments): mixed
{