-
Notifications
You must be signed in to change notification settings - Fork 7.9k
RFC: array_find #14108
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
RFC: array_find #14108
Conversation
cf2400c
to
828fda5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a quick look, have a few suggestions.
@@ -6581,6 +6581,165 @@ PHP_FUNCTION(array_filter) | |||
} | |||
/* }}} */ | |||
|
|||
/* {{{ Internal function to find an array element for a user closure. */ | |||
static zend_result php_array_find(const HashTable *array, zend_fcall_info fci, zend_fcall_info_cache fci_cache, zval *result_key, zval *result_value, bool negate_condition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone have an objection to making this ZEND_API
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no disagreement. I have chosen a lower visibility for the time being, as it is always easier to increase visibility afterwards instead of reducing it. But if you see a more global use case for the method, we can make it ZEND_API
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've now merged this as-is. The PHPAPI
can be added in a follow-up commit if necessary/desired.
@joshuaruesweg The build on master was briefly broken, a rebase will fix CI here. Sorry for that. |
Now merged, thank you. Don't forget to adjust the RFC status to "Implemented" and to add the link to the implementation. |
RFC: https://wiki.php.net/rfc/array_find
Closes #13996