dualfroz f032199075 fix: copy ArrayObject contents through recursiveCopy
ArrayObjectFilter copied each element through the public copy(), whose
first statement resets the object map. That map is what keeps one copy
per source object and what guards against cycles, so an object shared
inside an ArrayObject was duplicated and a graph whose cycle ran through
an ArrayObject recursed until memory ran out.

Reach recursiveCopy() through a bound closure, the way the sibling
SplDoublyLinkedListFilter already does. DeepCopy::copy() is unchanged.

ArrayObjectFilterTest stubbed the copy() call being removed, so it is
rewritten against a real DeepCopy like SplDoublyLinkedListFilterTest,
keeping its flags and iterator-class assertions.
2026-09-04 07:47:46 +02:00
S
Description
My contributions to myclabs/DeepCopy: 4 commits
45 KiB
0 Stars 1 Watchers 0 Forks
Languages
PHP 100%