Re: Proposal: addition of array_find() and array_find_key() functions
| From: | Jorg Sowa | Date: | Thu, 01 Jun 2023 19:48:19 +0000 |
| Subject: | Re: Proposal: addition of array_find() and array_find_key() functions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120504@lists.php.net to get a copy of this message | ||
Hey,
Native implementation of the function array_find would decrease number of
lines needed to perform basic loops over the arrays from 4-6 lines to just
1. And I recollect a few times when the argument of reducing lines of code
needed to type was a valid reason of implementing the change.
Moreover, only this function would allow to achieve the same result as
proposed functions any()/all() by Tyson Andre 3 years ago. I still cannot
understand the context why the rejection reasons as "Too small in
scope/Object to the choice of namespace/Prefer the global namespace"
prevented PHP to have something which is a basically standard in other
languages.
https://wiki.php.net/rfc/any_all_on_iterable
Kind regards,
Jorg