Skip to content

Commit eed8a51

Browse files
[VarDumper] Move locale sniffing to dump() time
1 parent 910a8de commit eed8a51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
3939
public function __construct($output = null, $charset = null)
4040
{
4141
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
42-
$this->decimalPoint = (string) 0.5;
43-
$this->decimalPoint = $this->decimalPoint[1];
42+
$this->decimalPoint = localeconv();
43+
$this->decimalPoint = $this->decimalPoint['decimal_point'];
4444
$this->setOutput($output ?: static::$defaultOutput);
4545
if (!$output && is_string(static::$defaultOutput)) {
4646
static::$defaultOutput = $this->outputStream;
@@ -134,6 +134,9 @@ public function setIndentPad($pad)
134134
*/
135135
public function dump(Data $data, $output = null)
136136
{
137+
$this->decimalPoint = localeconv();
138+
$this->decimalPoint = $this->decimalPoint['decimal_point'];
139+
137140
$exception = null;
138141
if ($output) {
139142
$prevOutput = $this->setOutput($output);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy