-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.5] Add the power of Arr::get() to Collection get() #22554
Conversation
By using Arr::get(), now It's possible to get nested value using collection get().
and tests … |
@Dylan-DPC Thanks.. |
Are we really really sure that we can just add new wildcard capabilities to such a globally used class like Collection without causing problems for people? Are we really sure that no one use |
|
Strictly spoken, this is a breaking change: (new Collection(['a' => ['b' => 'c']]))->get('a.b', 'd') returned |
@jeroennoten Yes, but can we do anything about it? It has already been merged and released. |
A rollback in a next version is an option. This is already done more often than once (e.g. #22478). But not sure if that is necessary, my comment was more or less informative without opinion. |
I also noticed that |
The new method not working as it should. I have the same problem. default value is always ignored and whole array is returned instead of null.... |
If you're experiencing problems that you believe is a bug, please open an issue and explain the problem in detail, including a description of the behavior before and after this pr. Your issue will be noticed much more quickly there than on a closed pr. |
Note how there's now a commit with the message "revert breaking change", but it didn't actually revert anything. There's now a follow up for the default value at #22837, but we're still using Arr::get which @jeroennoten has shown is a change in behavior. |
Reverting this entirely. |
By using
Arr::get()
, now It's possible to get nested value using collection get().