restore_error_handler

It restores the previous error handler

Example

<?php

function customError($errno, $errstr, $errfile, $errline)  {
echo $errno.””.$errstr.” , File name – “.$errfile.” at line No”.$errline;
}

set_error_handler(“customError”);

$val=5;

if ($val>1)  trigger_error(“An error occured”);

restore_error_handler();

if ($val>5)  trigger_error(“An error occured”);

?>

Output

1024An error occured , File name – /var/www/test/date/date.php at line No11

Share