From eb59baf337f61a6ead13127ee7e9b54c87ab550c Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 13 Sep 2019 14:42:57 +0200 Subject: [PATCH] fixes for PHP 7.4 --- src/Tracy/Debugger/Debugger.php | 2 +- tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tracy/Debugger/Debugger.php b/src/Tracy/Debugger/Debugger.php index 6790f09aa..e7b328943 100644 --- a/src/Tracy/Debugger/Debugger.php +++ b/src/Tracy/Debugger/Debugger.php @@ -262,7 +262,7 @@ public static function shutdownHandler(): void self::$reserved = null; $error = error_get_last(); - if (in_array($error['type'], [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE, E_RECOVERABLE_ERROR, E_USER_ERROR], true)) { + if (in_array($error['type'] ?? null, [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE, E_RECOVERABLE_ERROR, E_USER_ERROR], true)) { self::exceptionHandler( Helpers::fixStack(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'])), false diff --git a/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt b/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt index 90be618c1..6321dea7d 100644 --- a/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt +++ b/tests/Tracy/Debugger.E_RECOVERABLE_ERROR.phpt @@ -2,6 +2,7 @@ /** * Test: Tracy\Debugger E_RECOVERABLE_ERROR error. + * @phpversion < 7.4 */ declare(strict_types=1);