Skip to content

Commit eb4026b

Browse files
committed
bug symfony#32090 [Debug] workaround BC break in PHP 7.3 (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Debug] workaround BC break in PHP 7.3 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | https://github.com/symfony/symfony-standard/issues/1138 symfony/website-skeleton#231 | License | MIT | Doc PR | - A new warning has been added in PHP 7.3 that is breaking BC with Symfony, since we turn warnings into exceptions. This PR turns the new warning into a deprecation, so that we will be able to remove the added "if" in 5.0. I noticed a few other similar BC breaks in 7.1 and 7.2, but *unless someone reports that they block them*, I don't think we need to care. - 7.1 A non well formed numeric value encountered E_NOTICE - 7.1 A non-numeric value encountered E_WARNING - 7.2 count() now raises a warning when an invalid parameter is passed. See https://github.com/php/php-src/blob/PHP-7.1/UPGRADING + same in upper branches. Commits ------- d8d43e6 [Debug] workaround BC break in PHP 7.3
2 parents 459e791 + d8d43e6 commit eb4026b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Debug/ErrorHandler.php

+5
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ private function reRegister($prev)
382382
*/
383383
public function handleError($type, $message, $file, $line)
384384
{
385+
// @deprecated to be removed in Symfony 5.0
386+
if (\PHP_VERSION_ID >= 70300 && $message && '"' === $message[0] && 0 === strpos($message, '"continue') && preg_match('/^"continue(?: \d++)?" targeting switch is equivalent to "break(?: \d++)?"\. Did you mean to use "continue(?: \d++)?"\?$/', $message)) {
387+
$type = E_DEPRECATED;
388+
}
389+
385390
// Level is the current error reporting level to manage silent error.
386391
$level = error_reporting();
387392
$silenced = 0 === ($level & $type);

0 commit comments

Comments
 (0)