Skip to content

Conversation

@twose
Copy link
Member

@twose twose commented Sep 4, 2020

wonder if iterating over buckets in reverse would be more efficient for rejecting arrays that weren't list, here and in ext/json

E.g. if you had an array with thousands of elements, but a few were unset in the middle of the array, then the key of the last bucket (that wasn't unset) wouldn't be zend_hash_num_elements - 1

#4886 (comment)

@TysonAndre

I agree with you, I've been looking forward to this feature for a long time, thanks.

And It looks we need ZEND_HASH_REVERSE_FOREACH_KEY now.

@php-pulls php-pulls closed this in 40e5238 Sep 9, 2020
@twose twose deleted the foreach branch September 9, 2020 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants