如果我排除error_reporting()
E_WARNING
錯誤 - error_reporting(E_ALL & ~E_WARNING)
將我的自定義錯誤處理程序與set_error_handler('error_handler')
被調用PHP警告錯誤註冊?確實未納入的error_reporting的set_error_han dler捕獲錯誤()
我問這是因爲存在的Kohana框架下面的代碼:
public static function error_handler($code, $error, $file = NULL, $line = NULL)
{
if (error_reporting() & $code)
{
// This error is not suppressed by current error reporting settings
// Convert the error into an ErrorException
throw new ErrorException($error, $code, 0, $file, $line);
}
// Do not execute the PHP error handler
return TRUE;
}
,檢查觸發功能是否應該處理if (error_reporting() & $code)
而我希望的功能error_hanlder
被觸發永遠的錯誤那不應該被處理。