• PHP Video Tutorials

PHP - Function restore_error_handler()



Syntax

bool restore_error_handler ( void );

Definition and Usage

This function is used after changing the error handler function using set_error_handler(), to revert to the previous error handler (which could be the built-in or a user defined function)

Parameters

Sr.No Parameter & Description
1

void

NA

Return Value

This function always returns TRUE.

Example

Following is the usage of this function −

<?php
   function unserialize_handler($errno, $errstr) {
      echo "Invalid hello value.\n";
   }
   
   $hello = 'abc';
   set_error_handler('unserialize_handler');
   
   $original = unserialize($hello);
   restore_error_handler();
?> 

This will produce the following result −

Invalid hello value.
php_function_reference.htm
Advertisements