Skip to content

Implement array_search for all values (return array of keys) #2071

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

Conversation

remicollet
Copy link
Member

I notice there is no simple way to search all values in an array (to retrieve all the keys)

Here is a simple implementation.

I also add a ZVAL_STR_OR_LONG which can perhaps be moved in Zend, as probably used in lot of places.

7.1 seems a good candidate for a very minor self-contained change (else 7.2/master is fine)

@cmb69
Copy link
Member

cmb69 commented Aug 10, 2016

Perhaps a new function array_search_all() would be better (I find boolean arguments hard to understand, and we're already having $strict).

@remicollet
Copy link
Member Author

We already have array_keys(array, search) (thanks Nikita)

@remicollet remicollet closed this Aug 10, 2016
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