380b19a6d30f3cc17b0c21dab490f98f766b8fa2
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.
Languages
PHP
100%