TPhpErrorException represents an exception caused by a PHP error. This exception is mainly thrown within a PHP error handler.
Since: 3.0
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends TSystemException
Beispiel #1
0
 /**
  * PHP shutdown function used to catch fatal errors.
  * This method should be registered as PHP error handler using
  * {@link register_shutdown_function}. The method throws an exception that
  * contains the error information.
  */
 public static function phpFatalErrorHandler()
 {
     $error = error_get_last();
     if ($error && TPhpErrorException::isFatalError($error) && error_reporting() & $error['type']) {
         self::exceptionHandler(new TPhpErrorException($error['type'], $error['message'], $error['file'], $error['line']));
     }
 }