Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44ad424

Browse files
committed
Get attached info from clone
1 parent 5fe2db7 commit 44ad424

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/VarDumper/Caster/SplCaster.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $s
8686
$storage = array();
8787
unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967
8888

89-
foreach (clone $c as $obj) {
89+
$clone = clone $c;
90+
foreach ($clone as $obj) {
9091
$storage[spl_object_hash($obj)] = array(
9192
'object' => $obj,
92-
'info' => $c->getInfo(),
93+
'info' => $clone->getInfo(),
9394
);
9495
}
9596

0 commit comments

Comments
 (0)