Skip to content

Flesh out ZEND_HASH_REVERSE_FOREACH_* macros #6080

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

Closed
wants to merge 1 commit into from
Closed

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