Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP restore_error_handler() Function

PHP restore_error_handler() Function


PHP Error Reference Manual Complete PHP Error Reference Manual


Definition and Usage

The restore_error_handler() function restores the previous error handler.

This function is used to restore the previous error handler after it was changed by set_error_handler().

This function always returns TRUE.

Syntax

restore_error_handler()


Tips and Notes

**Tip:** The previous error handler may have been the built-in error handler or a user-defined function.


Example

Custom error: [$errno] $errstr
"; echo " Error on line $errline in $errfile
"; } //set user-defined error handler set_error_handler("customError"); $test=2; //trigger error if ($test>1) { trigger_error("A custom error has been triggered"); } //restore built-in error handler restore_error_handler(); //trigger error again if ($test>1) { trigger_error("A custom error has been triggered"); } ?>

The output of the code above is shown below:

Custom error:

[1024] A custom error has been triggered

Error on line 14 in C:webfoldertest.php

Notice

: A custom error has been triggered in

C:webfoldertest.php

on line

21


PHP Error Reference Manual Complete PHP Error Reference Manual