luofei614 / SocketLog

微信调试、API调试和AJAX的调试的工具,能将日志通过WebSocket输出到Chrome浏览器的console中
1.12k stars 299 forks source link

PHP7.0 会发送两次的问题 #32

Open sofire opened 7 years ago

sofire commented 7 years ago
public static function fatalError()
    {
        // 保存日志记录
        if ($e = error_get_last())
        {
                self::error_handler($e['type'],$e['message'],$e['file'],$e['line']);
                self::sendLog();//此类终止不会调用类的 __destruct 方法,所以此处手动sendLog
        }
    }

http://php.net/manual/en/function.error-get-last.php#113518 [Editor's note: as of PHP 7.0.0 there is error_clear_last() to clear the most recent error.]

需要添加 if (version_compare(PHP_VERSION, '7.0') >= 0){ error_clear_last(); }

luofei614 commented 7 years ago

收到, 感谢