function myErrorHandler ( $errno , $errstr , $errfile , $errline ) { if (!( error_reporting () & $errno )) { return; } switch ( $errno ) { case E_USER_ERROR : echo "<b>My ERROR</b> [ $errno ] $errstr <br /> " ; echo " Fatal error on line $errline in file $errfile " ; echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br /> " ; echo "Aborting...<br /> " ; exit( 1 ); break; case E_USER_WARNING : echo "<b>My WARNING</b> [ $errno ] $errstr <br /> " ; break; case E_USER_NOTICE : echo "<b>My NOTICE</b> [ $errno ] $errstr <br /> " ; break; default: echo "Unknown error type: [ $errno ] $errstr <br /> " ; break; } /* Don't execute PHP internal error handler */ return true ; } set_error_handler ( "myErrorHandler" );