Skip to content

Commit

Permalink
bug #36172 [Debug] fix for PHP 7.3.16+/7.4.4+ (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

[Debug] fix for PHP 7.3.16+/7.4.4+

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Should make tests green.
Follows php/php-src#5206, which is part of PHP 7.4.4 and 7.3.16.
The same patch is needed on the ErrorHandler component in 4.4 of course.

Commits
-------

b3d9a8a [Debug] fix for PHP 7.3.16+/7.4.4+
  • Loading branch information
nicolas-grekas committed Mar 23, 2020
2 parents e3cc3bd + b3d9a8a commit 0e2d5e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/ErrorHandler.php
Expand Up @@ -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();
}
Expand All @@ -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);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 0e2d5e9

Please sign in to comment.