tryphp_func_error_restore_error_handler.php:
Custom error: [$errno] $errstr
"; echo " Error on line $errline in $errfile
"; } // Set user-defined error handler function set_error_handler("myErrorHandler"); $test=2; // Trigger error if ($test>1) { trigger_error("A custom error has been triggered"); } // Restore previous error handler restore_error_handler(); // Trigger error again if ($test>1) { trigger_error("A custom error has been triggered"); } ?>
Custom error:
[1024] A custom error has been triggered
Error on line 19 in /home/Pz9OCu/prog.php