为什么php仍然报告错误?

为什么php仍然报告错误?,php,error-handling,error-reporting,simplesamlphp,Php,Error Handling,Error Reporting,Simplesamlphp,simplesamlPHP库中有一些代码 Logger::maskErrors(E_ALL); $hidden = in_array( self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY], true ); Logger::popErrorMask(); 因此,他们没有使用isset($metadata['EntityAttributes'][self::$

simplesamlPHP库中有一些代码

Logger::maskErrors(E_ALL);
$hidden = in_array(
    self::$HIDE_FROM_DISCOVERY, 
    $metadata['EntityAttributes'][self::$ENTITY_CATEGORY], 
    true
);
Logger::popErrorMask();
因此,他们没有使用isset($metadata['EntityAttributes'][self::$ENTITY\u CATEGORY])而是决定将错误报告设置为0,然后恢复它。问题是,当我以脚本的形式运行它时,它可以工作,但是当我将它插入到框架时,它仍然会失败,并出现错误。 虽然我在那里转储了level,它实际上被设置为0


我还听说,如果您设置了一个用户定义的错误处理函数,那么error_reporting()设置将被完全忽略。但是全局搜索在项目中没有返回设置错误处理程序。

仍然是
设置错误处理程序()
,我没有正确查看供应商文件夹。它在拉雷维尔起作用的原因是:

 public function handleError($level, $message, $file = '', $line = 0, $context = [])
    {
        if (error_reporting() & $level) {
            throw new ErrorException($message, 0, $level, $file, $line);
        }
    }
但我的框架有:

    public function handleError($code, $message, $filename = '', $line = 0)
    {
        throw new \ErrorException($message, $code, 0, $filename, $line);
    }

尽管是
set\u error\u handler()
,但我没有正确查看供应商文件夹。它在拉雷维尔起作用的原因是:

 public function handleError($level, $message, $file = '', $line = 0, $context = [])
    {
        if (error_reporting() & $level) {
            throw new ErrorException($message, 0, $level, $file, $line);
        }
    }
但我的框架有:

    public function handleError($code, $message, $filename = '', $line = 0)
    {
        throw new \ErrorException($message, $code, 0, $filename, $line);
    }