Skip to content

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

Merged
merged 15 commits into from
May 31, 2024
Merged

RFC: array_find #14108

merged 15 commits into from
May 31, 2024

Conversation

joshuaruesweg
Copy link
Member

@joshuaruesweg joshuaruesweg commented May 1, 2024

@joshuaruesweg joshuaruesweg force-pushed the array_find branch 2 times, most recently from cf2400c to 828fda5 Compare May 1, 2024 20:20
@TimWolla TimWolla added the RFC label May 1, 2024
Copy link
Contributor

@morrisonlevi morrisonlevi left a 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)
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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.

@nielsdos
Copy link
Member

@joshuaruesweg The build on master was briefly broken, a rebase will fix CI here. Sorry for that.

@joshuaruesweg joshuaruesweg marked this pull request as ready for review May 30, 2024 12:02
@joshuaruesweg joshuaruesweg requested a review from kocsismate as a code owner May 30, 2024 12:02
@joshuaruesweg joshuaruesweg requested a review from bukka as a code owner May 30, 2024 12:02
@TimWolla TimWolla merged commit e4a8d5b into php:master May 31, 2024
2 checks passed
@TimWolla
Copy link
Member

Now merged, thank you. Don't forget to adjust the RFC status to "Implemented" and to add the link to the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment