sebastianbergmann / recursion-context

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

Edge-case path is broken #25

Closed cscott closed 2 years ago

cscott commented 2 years ago

The fix for bug #3 (PR #4) contained some code in addArray that attempted to handle the case where the "highest two" array indexes were already in use. However, the corresponding code in containsArray seems to have been overlooked/forgotten. The containsArray function should also check to see if the highest two array indexes are in use, and if so undertake an exhaustive search for the elements added by addArray.

cscott commented 2 years ago

Never mind, that code is crazy like a fox. Never thought array_slice behaved that way. Cool, I guess?