mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-29 23:26:44 +00:00
Remove the numeric locale switch when compiling number literals
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user