From b3d9a8ac300d6ade6697fbdb7cdd614832f3fef0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 23 Mar 2020 11:22:40 +0100 Subject: [PATCH] [Debug] fix for PHP 7.3.16+/7.4.4+ --- src/Symfony/Component/Debug/ErrorHandler.php | 4 ++-- src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index dfd63b85c87b..40a4b1758ce7 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -521,7 +521,7 @@ public function handleError($type, $message, $file, $line) $errorAsException ? ['exception' => $errorAsException] : [], ]; } else { - if (!\defined('HHVM_VERSION')) { + if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404) && !\defined('HHVM_VERSION')) { $currentErrorHandler = set_error_handler('var_dump'); restore_error_handler(); } @@ -533,7 +533,7 @@ public function handleError($type, $message, $file, $line) } finally { $this->isRecursive = false; - if (!\defined('HHVM_VERSION')) { + if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404) && !\defined('HHVM_VERSION')) { set_error_handler($currentErrorHandler); } } diff --git a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php index 2cf75a0e8e32..01c63aea88e3 100644 --- a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php @@ -327,8 +327,6 @@ public function testHandleDeprecation() $handler = new ErrorHandler(); $handler->setDefaultLogger($logger); @$handler->handleError(E_USER_DEPRECATED, 'Foo deprecation', __FILE__, __LINE__, []); - - restore_error_handler(); } /**