English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Error & Loggings Reference Manual
The restore_error_handler() function restores the previous error handler
bool restore_error_handler(void);
After changing the error handler with set_error_handler(), this function can be used to restore the previous error handler (which can be built-in or user-defined).
Serial Number | Parameters and Description |
---|---|
1 | void No parameters required |
This function always returns TRUE.
The following is the usage of this function, if unserialize() causes an error, the original error handler will be restored next.
<?php function unserialize_handler($errno, $errstr) { echo "Invalid hello value.\n"; } $hello = 'abc'; set_error_handler('unserialize_handler'); $original = unserialize($hello); restore_error_handler(); ?>Test to see‹/›
This will produce the following result-
Invalid hello value.