Restore the previous error handler after it has been changed using the set_error_handler()
function.
<?php // A user-defined error handler function function myErrorHandler($errno, $errstr, $errfile, $errline) { echo “<b>Custom error:</b> [$errno] $errstr<br>”; echo ” Error on line $errline in $errfile<br>”; } // 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”); } ?> |
The restore_error_handler()
function restores the previous error handler.
Use this function to revert to the previous error handler after it has been modified with the set_error_handler()
function.
Tip: The previous error handler might be either a built-in error handler or a user-defined function.
restore_error_handler(); |
Return Value: |
Always returns |
PHP Version: |
4.0.1+ |