From 96271b3644a3f919c4ad2b9e06668b9620dc40c7 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 16 Jul 2023 17:37:21 +0200 Subject: [PATCH] [Runtime][ErrorHandler] Don't mess with ini_set('assert.warning') --- src/Symfony/Component/ErrorHandler/Debug.php | 1 - src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php | 2 ++ src/Symfony/Component/Runtime/Internal/BasicErrorHandler.php | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/ErrorHandler/Debug.php b/src/Symfony/Component/ErrorHandler/Debug.php index 343a35a77b11b..60ddb452c0385 100644 --- a/src/Symfony/Component/ErrorHandler/Debug.php +++ b/src/Symfony/Component/ErrorHandler/Debug.php @@ -31,7 +31,6 @@ public static function enable(): ErrorHandler @ini_set('zend.assertions', 1); ini_set('assert.active', 1); - ini_set('assert.warning', 0); ini_set('assert.exception', 1); DebugClassLoader::enable(); diff --git a/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php b/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php index 8f57bb53b8cb5..5462a9f230b5b 100644 --- a/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php @@ -665,6 +665,7 @@ public function testAssertQuietEval() $this->markTestSkipped('zend.assertions is forcibly disabled'); } + set_error_handler(function () {}); $ini = [ ini_set('zend.assertions', 1), ini_set('assert.active', 1), @@ -673,6 +674,7 @@ public function testAssertQuietEval() ini_set('assert.callback', null), ini_set('assert.exception', 0), ]; + restore_error_handler(); $logger = new BufferingLogger(); $handler = new ErrorHandler($logger); diff --git a/src/Symfony/Component/Runtime/Internal/BasicErrorHandler.php b/src/Symfony/Component/Runtime/Internal/BasicErrorHandler.php index 3c97cba4baf8d..6f41af585e616 100644 --- a/src/Symfony/Component/Runtime/Internal/BasicErrorHandler.php +++ b/src/Symfony/Component/Runtime/Internal/BasicErrorHandler.php @@ -32,7 +32,6 @@ public static function register(bool $debug): void if (0 <= \ini_get('zend.assertions')) { ini_set('zend.assertions', 1); ini_set('assert.active', $debug); - ini_set('assert.warning', 0); ini_set('assert.exception', 1); }