public static function registerExceptionHandler() { static::$previousHandlers['exception'] = set_exception_handler(function ($exception) { Debugger::handleException($exception); if (Debugger::$previousHandlers['exception']) { call_user_func(Debugger::$previousHandlers['exception'], $exception); } }); }