Monday, 26 August 2013

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)

Paramters

ParameterDescription
voidNA

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 following result:
Invalid serialized value.

No comments:

Post a Comment