Skip to content

Commit cdcadd3

Browse files
Merge branch '4.4' into 5.4
* 4.4: [VarDumper] Fix dumping floats on PHP8 Fix dumping enums on PHP 8.2 [Cache] Prevent fatal errors on php 8 when running concurrently with TagAwareAdapter v6.1
2 parents 6bad663 + 58eb360 commit cdcadd3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Dumper/AbstractDumper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public function __construct($output = null, string $charset = null, int $flags =
4646
{
4747
$this->flags = $flags;
4848
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
49-
$this->decimalPoint = localeconv();
50-
$this->decimalPoint = $this->decimalPoint['decimal_point'];
49+
$this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point'];
5150
$this->setOutput($output ?: static::$defaultOutput);
5251
if (!$output && \is_string(static::$defaultOutput)) {
5352
static::$defaultOutput = $this->outputStream;
@@ -120,8 +119,7 @@ public function setIndentPad(string $pad)
120119
*/
121120
public function dump(Data $data, $output = null)
122121
{
123-
$this->decimalPoint = localeconv();
124-
$this->decimalPoint = $this->decimalPoint['decimal_point'];
122+
$this->decimalPoint = \PHP_VERSION_ID >= 80000 ? '.' : localeconv()['decimal_point'];
125123

126124
if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) {
127125
setlocale(\LC_NUMERIC, 'C');

0 commit comments

Comments
 (0)