bug #37921 [Yaml] account for is_numeric() behavior changes in PHP 8 (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] account for is_numeric() behavior changes in PHP 8

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

Commits
-------

05db8e0fef account for is_numeric() behavior changes in PHP 8
This commit is contained in:
Fabien Potencier 2020-08-23 11:03:06 +02:00
commit 4b3d5b6c00

View File

@ -210,7 +210,7 @@ class Inline
return 'false';
case ctype_digit($value):
return \is_string($value) ? "'$value'" : (int) $value;
case is_numeric($value):
case is_numeric($value) && false === strpos($value, "\n"):
$locale = setlocale(LC_NUMERIC, 0);
if (false !== $locale) {
setlocale(LC_NUMERIC, 'C');