public function handleError($type, $message, $file = '', $line = 0, $context = array()) { // http://php.net/set_error_handler // The following error types cannot be handled with a user defined function: E_ERROR, // E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and // most of E_STRICT raised in the file where set_error_handler() is called. if (error_reporting() !== 0) { $error_types = $this->error_types; if ($error_types === null) { $error_types = error_reporting(); } if ($error_types & $type) { $e = new ErrorException($message, 0, $type, $file, $line); $this->handleException($e, true, $context); } } if ($this->call_existing_error_handler) { if ($this->old_error_handler !== null) { return call_user_func( $this->old_error_handler, $type, $message, $file, $line, $context ); } else { return false; } } return true; }