- set_exception_handler: documentation ( source)
<?php
class Log {
public static function enableHandler() {
set_exception_handler(['Log', '_handleException']);
}
protected static function _handleException(Throwable $exception) {
}
}
Log::enableHandler();
throw Exception();