Skip to content

Commit e2a6952

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Backport: Improve link script with rollback when using symlink fix more numeric cases changing in PHP 8
2 parents 2061f4a + 4152e36 commit e2a6952

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Inline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public static function dump($value, int $flags = 0): string
161161
return 'false';
162162
case ctype_digit($value):
163163
return \is_string($value) ? "'$value'" : (int) $value;
164-
case is_numeric($value) && false === strpos($value, "\n"):
164+
case is_numeric($value) && false === strpos($value, "\f") && false === strpos($value, "\n") && false === strpos($value, "\r") && false === strpos($value, "\t") && false === strpos($value, "\v"):
165165
$locale = setlocale(LC_NUMERIC, 0);
166166
if (false !== $locale) {
167167
setlocale(LC_NUMERIC, 'C');

Tests/InlineTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,14 @@ public function getTestsForDump()
503503
['[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', ['foo', '@foo.baz', ['%foo%' => 'foo is %foo%', 'bar' => '%foo%'], true, '@service_container']],
504504

505505
['{ foo: { bar: { 1: 2, baz: 3 } } }', ['foo' => ['bar' => [1 => 2, 'baz' => 3]]]],
506+
507+
// numeric strings with trailing whitespaces
508+
["'0123 '", '0123 '],
509+
['"0123\f"', "0123\f"],
510+
['"0123\n"', "0123\n"],
511+
['"0123\r"', "0123\r"],
512+
['"0123\t"', "0123\t"],
513+
['"0123\v"', "0123\v"],
506514
];
507515
}
508516

0 commit comments

Comments
 (0)