这是我的定义:
set_error_handler('errorHandler', E_ALL ^ E_NOTICE ^ E_STRICT ^ E_DEPRECATED);
因此,从本质上讲,我给set_error_handler的值为22519,其中不包括上述错误类型。但是,我的
errorHandler
函数仍然收到严格的错误。我尚未通过通知对其进行测试。我的功能很基本:function errorHandler($number, $string, $file, $line) {
$message = "$number: $string in $file on line $line";
throw new \Exception($message, $number);
}
我得到的东西是:
Exception 2048 2048: Declaration of X should be compatible with that of Y in XF on line 19 in ErrorHandler.php on line 70
如您所知,我希望所有PHP错误都抛出一个异常,以便于调试。
最佳答案
关于php - 为什么set_error_handler不排除不是error_types的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22546832/