Skip to content

Commit 6fc6087

Browse files
committed
[VarDumper] Backport handler lock when using VAR_DUMPER_FORMAT
1 parent 88de6fd commit 6fc6087

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)