laravel/framework — pull request #5715 by jchamberlain (2014-09-12 00:33:33+00:00)
Title: Prevent array_forget() from mixing up references

As `Arr::forget()` iteratively descends through `$array`, it changes the reference. If only one key is provided, or if all keys to forget have the same parent, that's ok. But since it never ascends back up to the original `$array` additional unrelated keys cause some very funny things to start happening.

This PR includes the fix and an addition to `testArrayForget()` which will reproduce the problem in the old code.