PHP - Function restore_error_handler()


Advertisements


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

Parameter Description
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 serialized value.\n";
   }
   
   $serialized = 'foo';
   set_error_handler('unserialize_handler');
   
   $original = unserialize($serialized);
   restore_error_handler();
?> 

This will produce the following result −

Invalid serialized value.

php_function_reference.htm

Advertisements