bug #34126 [VarDumper] fix infinite recursion (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] fix infinite recursion

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

56d9f47857 [VarDumper] fix infinite recursion
This commit is contained in:
Fabien Potencier 2019-10-26 21:52:16 +02:00
commit b54997d1df
2 changed files with 2 additions and 2 deletions

View File

@ -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)) {

View File

@ -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);