Remove the numeric locale switch when compiling number literals

This commit is contained in:
Fabien Potencier
2026-10-22 11:37:13 -07:00
parent a50e9b7fe0
commit 83a4f669db
-8
View File
@@ -162,10 +162,6 @@ class Compiler
public function repr($value)
{
if (\is_int($value) || \is_float($value)) {
if (false !== $locale = setlocale(\LC_NUMERIC, '0')) {
setlocale(\LC_NUMERIC, 'C');
}
// var_export() follows serialize_precision, -1 gives the shortest representation that reads back as the same float
$precision = \is_float($value) ? ini_set('serialize_precision', '-1') : false;
@@ -174,10 +170,6 @@ class Compiler
if (false !== $precision) {
ini_set('serialize_precision', $precision);
}
if (false !== $locale) {
setlocale(\LC_NUMERIC, $locale);
}
} elseif (null === $value) {
$this->raw('null');
} elseif (\is_bool($value)) {