restore_error_handler — 还原之前的错误处理函数
说明
bool restore_error_handler ( void )
在使用 set_error_handler() 改变错误处理函数之后,此函数可以 用于还原之前的错误处理程序(可以是内置的或者也可以是用户所定义的函数)。
返回值
该函数总是返回 TRUE 。
立即学习“PHP免费学习笔记(深入)”;
restore_error_handler() 实例
如果是 unserialize() 导致了一个错误,接下来 会恢复原来的错误处理函数。
以上例程会输出:
一个功能强大的B2B与B2C的购物平台,除了原本OSC功能外,增加更新的功能: 一、 取消了register_globals必须开启的限制 二、 將HTML程式碼与PHP程式碼完全分离,採用了smarty 樣板引擎 三、 每支档案includes所需函数与资料库连结,使的网页显示速度明显提升 四、 检视、购买商品群组权限设定 五、 十八岁以下禁购机制 六、 折价券购物抵扣机制 七、 礼券购物机制
Invalid serialized value.
restore_exception_handler — 恢复之前定义过的异常处理函数。
说明
bool restore_exception_handler ( void )
在使用 set_exception_handler() 改变异常处理函数之后,此函数可以 用于还原之前的异常处理程序(可以是内置的或者也可以是用户所定义的函数)。
返回值
该函数总是返回 TRUE 。
restore_exception_handler()函数实例
getMessage ();
}
function exception_handler_2 ( Exception $e )
{
echo '[' . FUNCTION . '] ' . $e -> getMessage ();
}
set_exception_handler ( 'exception_handler_1' );
set_exception_handler ( 'exception_handler_2' );
restore_exception_handler ();
throw new Exception ( 'This triggers the first exception handler...' );
?>以上例程会输出:
[exception_handler_1] This triggers the first exception handler...









