SocketLog icon indicating copy to clipboard operation
SocketLog copied to clipboard

PHP7.0 会发送两次的问题

Open sofire opened this issue 8 years ago • 1 comments

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(); }

sofire avatar Feb 10 '17 09:02 sofire

收到, 感谢

luofei614 avatar Feb 11 '17 02:02 luofei614