4 Commits
Author SHA1 Message Date
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
upstream 3814b3f178 Upstream myclabs/DeepCopy state of the touched files before 14923870ae 2026-09-04 07:47:46 +02:00
dualfroz 380b19a6d3 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-06 00:57:10 +02:00
upstream b66e64a804 Upstream myclabs/DeepCopy state of the touched files before e44a99f406 2026-09-04 07:47:46 +02:00