【发布时间】:2019-01-09 11:17:36
【问题描述】:
为什么还要使用我用 set_error_handler 设置的自定义错误处理程序消息获取默认错误处理程序消息,这是我下面的代码
function custom_handler($error_level,$error_message){
echo "[$error_level] $error_message";
}
set_error_handler("custom_handler",E_WARNING);
require_once('try.php')
这是输出
"[2] require_once(try.php): 无法打开流: 没有这样的文件或 目录致命错误:require_once():需要打开失败 'try.php' (include_path='D:\software\xampp\php\PEAR') 在 D:\software\xampp\htdocs\samples\code.php 第 14 行"
【问题讨论】:
-
如果我没记错(并且没有过时)set_error_handler 不会处理致命错误。
标签: php