-
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.4] Higher Order Array or Object Bug Fix #16274
[5.4] Higher Order Array or Object Bug Fix #16274
Conversation
…bowers/framework into hotfix/higher_order_array_or_object
Personally I would suggest just checking for is_array. It will be much faster than data_get in this situation. |
Feel free to modify as you see fit. I assume you mean to do |
yes. |
@taylorotwell This change has been made. |
I highly advise against this. There's already enough magic involved. If you're dealing with arrays, accessing them should work like this:
We can do this by implementing |
I'm happy for this to be altered if it improves the code / expectations of the code; however I would say a common API is preferential to it throwing an error if you try to access the collection as shown in the examples, and it happens to be an array. Offtopic: @franzliedke I have sent you a message on larachat, if you get the chance to check it out, i'd be grateful :) |
Collection items don't just happen to be arrays, though. You should know what you're dealing with when you are accessing a whole collection through the proxy. That's the point of this feature: accessing all items in a collection just like you would access one object, which you can do because they all have the same type/interface. I want this to be as expectable as possible. I've seen your message, I will get to it. ;) |
No description provided.