- set_exception_handler: documentation ( source)
<?php
class ExceptionHandler
{
public function __invoke(Exception $e)
{
echo $exception->getMessage();
}
}
set_exception_handler(new ExceptionHandler);
throw new Exception("Test");