Skip to content

Commit

Permalink
clone Ds\Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Apr 1, 2023
1 parent a9da0b0 commit 3f33f90
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tracy/Dumper/Exposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static function exposeDsCollection(
Describer $describer,
): void
{
foreach ($obj as $k => $v) {
foreach (clone $obj as $k => $v) {
$describer->addPropertyTo($value, (string) $k, $v);
}
}
Expand Down
23 changes: 23 additions & 0 deletions tests/Tracy/Dumper.toText().specials.ds.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,26 @@ Assert::match(
XX,
Dumper::toText($map),
);


$queue = new Ds\Queue(['value']);
Assert::match(
<<<'XX'
Ds\Queue #%d%
0: 'value'
XX,
Dumper::toText($queue),
);
Assert::count(1, $queue);


$stack = new Ds\Stack(['value']);
Assert::match(
<<<'XX'
Ds\Stack #%d%
0: 'value'
XX,
Dumper::toText($stack),
);
Assert::count(1, $stack);

0 comments on commit 3f33f90

Please sign in to comment.