无涯教程-PHP错误处理函数 - restore_error_handler()

39 阅读1分钟

restore_error_handler() - 语法

bool restore_error_handler ( void );

此函数在使用set_error_handler()更改错误处理程序函数后使用,以恢复到以前的错误处理程序(可以是内置的或用户定义的函数)

restore_error_handler() - 示例

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

这将产生以下输出-

Invalid hello value.

参考链接

www.learnfk.com/php/php-fun…