8000 minor #47100 [Debug][ErrorHandler] fix operator precedence (guilliamx… · symfony/symfony@9fb7f20 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fb7f20

Browse files
minor #47100 [Debug][ErrorHandler] fix operator precedence (guilliamxavier)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [Debug][ErrorHandler] fix operator precedence | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #10921 (comment) | License | MIT But I'm struggling to come up with a *failing* test scenario :/ if the bug is only causing evaluating the condition as truthy instead of false when `$prev` is already equal to `$this->thrownErrors | $this->loggedErrors`, I guess it will just re-register the same, without real visible effect? Commits ------- 7f68914 [Debug][ErrorHandler] fix operator precedence
2 parents 57e5141 + 7f68914 commit 9fb7f20

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public function screamAt($levels, $replace = false)
354354
*/
355355
private function reRegister(int $prev)
356356
{
357-
if ($prev !== $this->thrownErrors | $this->loggedErrors) {
357+
if ($prev !== ($this->thrownErrors | $this->loggedErrors)) {
358358
$handler = set_error_handler('is_int');
359359
$handler = \is_array($handler) ? $handler[0] : null;
360360
restore_error_handler();

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ public function screamAt(int $levels, bool $replace = false): int
374374
*/
375375
private function reRegister(int $prev): void
376376
{
377-
if ($prev !== $this->thrownErrors | $this->loggedErrors) {
377+
if ($prev !== ($this->thrownErrors | $this->loggedErrors)) {
378378
$handler = set_error_handler('is_int');
379379
$handler = \is_array($handler) ? $handler[0] : null;
380380
restore_error_handler();

0 commit comments

Comments
 (0)
0