From 56d9f47857290802ac5a64d893568d3b73e82e53 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 26 Oct 2019 10:24:21 +0200 Subject: [PATCH] [VarDumper] fix infinite recursion --- src/Symfony/Component/VarDumper/Caster/ClassStub.php | 2 +- src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Caster/ClassStub.php b/src/Symfony/Component/VarDumper/Caster/ClassStub.php index 0b9329dbe9..b6c45456d2 100644 --- a/src/Symfony/Component/VarDumper/Caster/ClassStub.php +++ b/src/Symfony/Component/VarDumper/Caster/ClassStub.php @@ -62,7 +62,7 @@ class ClassStub extends ConstStub } if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) { - $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true); + $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE); $s = ReflectionCaster::getSignature($s); if ('()' === substr($identifier, -2)) { diff --git a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php index 7a6e89ad77..8208cf74cd 100644 --- a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php @@ -212,7 +212,7 @@ class ReflectionCaster $a[$prefix.'parameters'] = new EnumStub($a[$prefix.'parameters']); } - if ($v = $c->getStaticVariables()) { + if (!($filter & Caster::EXCLUDE_VERBOSE) && $v = $c->getStaticVariables()) { foreach ($v as $k => &$v) { if (\is_object($v)) { $a[$prefix.'use']['$'.$k] = new CutStub($v);