Skip to content

Commit f77161b

Browse files
[VarDumper] Move locale sniffing to dump() time
1 parent 30b409a commit f77161b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public function __construct($output = null, $charset = null, $flags = 0)
4444
{
4545
$this->flags = (int) $flags;
4646
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
47-
$this->decimalPoint = (string) 0.5;
48-
$this->decimalPoint = $this->decimalPoint[1];
47+
$this->decimalPoint = localeconv()['decimal_point'];
4948
$this->setOutput($output ?: static::$defaultOutput);
5049
if (!$output && is_string(static::$defaultOutput)) {
5150
static::$defaultOutput = $this->outputStream;
@@ -121,6 +120,8 @@ public function setIndentPad($pad)
121120
*/
122121
public function dump(Data $data, $output = null)
123122
{
123+
$this->decimalPoint = localeconv()['decimal_point'];
124+
124125
if ($returnDump = true === $output) {
125126
$output = fopen('php://memory', 'r+b');
126127
}

0 commit comments

Comments
 (0)