Skip to content

Commit 8b9bbbb

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: Fix Warning: curl_multi_select(): timeout must be positive [PropertyInfo] Fix ReflectionExtractor handling of underscore-only property names ObjectNormalizer: allow null and scalar [Security] Fix `HttpUtils::createRequest()` when the context’s base URL isn’t empty [Serializer] fix Inherited properties normalization [OptionsResolver] Fix missing prototype key in nested error paths Bump Symfony version to 7.3.8 Update VERSION for 7.3.7 Update CHANGELOG for 7.3.7 Bump Symfony version to 6.4.30 Update VERSION for 6.4.29 Update CHANGELOG for 6.4.29 [Yaml] Fix parsing of unquoted multiline scalars with comments or blank lines [Clock] Align MockClock::sleep() behavior with NativeClock for negative values [OptionsResolver] Ensure remove() also unsets deprecation status Remove review state for Belarusian translations (entries 141 and 142) [ExpressionLanguage] Compile numbers with var_export in Compiler::repr for thread-safety compatibility with ext-redis 6.3 [Serializer] Fix BackedEnumNormalizer behavior with partial denormalization [HttpFoundation] Fix parsing pathinfo with no leading slash
2 parents b53192c + cd87867 commit 8b9bbbb

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

Compiler.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,7 @@ public function string(string $value): static
107107
public function repr(mixed $value): static
108108
{
109109
if (\is_int($value) || \is_float($value)) {
110-
if (false !== $locale = setlocale(\LC_NUMERIC, 0)) {
111-
setlocale(\LC_NUMERIC, 'C');
112-
}
113-
114-
$this->raw($value);
115-
116-
if (false !== $locale) {
117-
setlocale(\LC_NUMERIC, $locale);
118-
}
110+
$this->raw(var_export($value, true));
119111
} elseif (null === $value) {
120112
$this->raw('null');
121113
} elseif (\is_bool($value)) {

Tests/Node/ConstantNodeTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,40 @@ public static function getEvaluateData(): array
3131
public static function getCompileData(): array
3232
{
3333
return [
34+
// Booleans
3435
['false', new ConstantNode(false)],
3536
['true', new ConstantNode(true)],
37+
38+
// Null
3639
['null', new ConstantNode(null)],
40+
41+
// Integers
3742
['3', new ConstantNode(3)],
43+
['-10', new ConstantNode(-10)],
44+
['0', new ConstantNode(0)],
45+
46+
// Floats
3847
['3.3', new ConstantNode(3.3)],
48+
['42.0', new ConstantNode(42.0)],
49+
['-1.23', new ConstantNode(-1.23)],
50+
['0.1', new ConstantNode(0.1)],
51+
['1.0', new ConstantNode(1.0)],
52+
['1.0E-6', new ConstantNode(1.0e-6)],
53+
['1.23456789E+20', new ConstantNode(1.23456789e+20)],
54+
['3.3', new ConstantNode(3.2999999999999998)],
55+
['0.30000000000000004', new ConstantNode(0.1 + 0.2)],
56+
['INF', new ConstantNode(\INF)],
57+
['-INF', new ConstantNode(-\INF)],
58+
['NAN', new ConstantNode(\NAN)],
59+
60+
// Strings
3961
['"foo"', new ConstantNode('foo')],
62+
['""', new ConstantNode('')],
63+
['"a\\"b"', new ConstantNode('a"b')],
64+
65+
// Arrays
4066
['[0 => 1, "b" => "a"]', new ConstantNode([1, 'b' => 'a'])],
67+
['[]', new ConstantNode([])],
4168
];
4269
}
4370

0 commit comments

Comments
 (0)