8000 bug #23176 [VarDumper] fixes (nicolas-grekas) · symfony/symfony@d1104da · GitHub
[go: up one dir, main page]

Skip to content

Commit d1104da

Browse files
committed
bug #23176 [VarDumper] fixes (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [VarDumper] fixes | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23115 and #23151 (hopefully) | License | MIT | Doc PR | - it looks like stream_context_get_params can return false (looking at php-src and #23151) and doing a foreach on SplObjectStorage changes its internal iterator state. Commits ------- d7238c9 [VarDumper] fixes
2 parents 78f028c + d7238c9 commit d1104da

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static function castStream($stream, array $a, Stub $stub, $isNested)
4545

4646
public static function castStreamContext($stream, array $a, Stub $stub, $isNested)
4747
{
48-
return stream_context_get_params($stream);
48+
return @stream_context_get_params($stream) ?: $a;
4949
}
5050

5151
public static function castGd($gd, array $a, Stub $stub, $isNested)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ 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 ($c as $obj) {
89+
foreach (clone $c as $obj) {
9090
$storage[spl_object_hash($obj)] = array(
9191
'object' => $obj,
9292
'info' => $c->getInfo(),

0 commit comments

Comments
 (0)
0