10000 bug #23574 [VarDumper] Move locale sniffing to dump() time (nicolas-g… · symfony/symfony@2040770 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2040770

Browse files
committed
bug #23574 [VarDumper] Move locale sniffing to dump() time (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [VarDumper] Move locale sniffing to dump() time | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23572 | License | MIT | Doc PR | - Commits ------- eed8a51 [VarDumper] Move locale sniffing to dump() time
2 parents 910a8de + eed8a51 commit 2040770

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)
0