Skip to content

Commit 8205581

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: [Serializer] Fix variadic support when using type hints [VarDumper] Backport handler lock when using VAR_DUMPER_FORMAT
2 parents a413888 + 6fc6087 commit 8205581

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

VarDumper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public static function dump($var)
5353
public static function setHandler(callable $callable = null)
5454
{
5555
$prevHandler = self::$handler;
56+
57+
// Prevent replacing the handler with expected format as soon as the env var was set:
58+
if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
59+
return $prevHandler;
60+
}
61+
5662
self::$handler = $callable;
5763

5864
return $prevHandler;

0 commit comments

Comments
 (0)