sebastianbergmann / recursion-context

Provides functionality to recursively process PHP variables
BSD 3-Clause "New" or "Revised" License
6.52k stars 18 forks source link

Fixed issue #3 - Use an O(1) approach for each array check #4

Closed bwoebi closed 7 years ago

bwoebi commented 7 years ago

This adds two extra elements, one unique identifier (in this case $this->objects, which ought to be definitely not be accessed anywhere else) and the key for that array.

To check whether the array has already been checked, just these extra elements are verified.

At the end, these are removed again.