1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<?php function errorHandler($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_NOTICE: case E_USER_NOTICE: case E_DEPRECATED: case E_USER_DEPRECATED: case E_STRICT: //echo("STRICT error $errstr at $errfile:$errline \n"); break; case E_WARNING: case E_USER_WARNING: echo("WARNING error $errstr at $errfile:$errline \n"); break; case E_ERROR: case E_USER_ERROR: case E_RECOVERABLE_ERROR: exit("FATAL error $errstr at $errfile:$errline \n"); default: exit("Unknown error at $errfile:$errline \n"); } } set_error_handler("errorHandler"); php?> |