Skip to content

Commit 0c1e73e

Browse files
bug #50994 [ErrorHandler][Runtime] Don't mess with ini_set('assert.warning') (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [ErrorHandler][Runtime] Don't mess with ini_set('assert.warning') | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - From https://wiki.php.net/rfc/assert-string-eval-cleanup#assertwarning: > As of PHP 7, this setting only has an effect if assert.exception is disabled Commits ------- 96271b3 [Runtime][ErrorHandler] Don't mess with ini_set('assert.warning')
2 parents 6f2e603 + 96271b3 commit 0c1e73e

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

src/Symfony/Component/ErrorHandler/Debug.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public static function enable(): ErrorHandler
3131

3232
@ini_set('zend.assertions', 1);
3333
ini_set('assert.active', 1);
34-
ini_set('assert.warning', 0);
3534
ini_set('assert.exception', 1);
3635

3736
DebugClassLoader::enable();

src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ public function testAssertQuietEval()
665665
$this->markTestSkipped('zend.assertions is forcibly disabled');
666666
}
667667

668+
set_error_handler(function () {});
668669
$ini = [
669670
ini_set('zend.assertions', 1),
670671
ini_set('assert.active', 1),
@@ -673,6 +674,7 @@ public function testAssertQuietEval()
673674
ini_set('assert.callback', null),
674675
ini_set('assert.exception', 0),
675676
];
677+
restore_error_handler();
676678

677679
$logger = new BufferingLogger();
678680
$handler = new ErrorHandler($logger);

src/Symfony/Component/Runtime/Internal/BasicErrorHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public static function register(bool $debug): void
3232
if (0 <= \ini_get('zend.assertions')) {
3333
ini_set('zend.assertions', 1);
3434
ini_set('assert.active', $debug);
35-
ini_set('assert.warning', 0);
3635
ini_set('assert.exception', 1);
3736
}
3837

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy