/** * PHP 5 Constructor */ public function __construct() { parent::__construct(); $this->x_error_handler = function ($arr, $exception = false) { // if has fatal error if (!empty($arr['is_fatal'])) { if (is_callable(Route::getDefault500())) { Route::setDefault500(array("\\" . __NAMESPACE__ . "\\Controller", 'error500')); } return call_user_func_array(Route::getDefault500(), array($arr)); } }; $this->x_isexception = false; /** * Register */ set_error_handler(array($this, 'handleError')); set_exception_handler(array($this, 'handleException')); register_shutdown_function(array($this, 'handleShutdown')); }