Re: Proposal: addition of array_find() and array_find_key() functions
| From: | Pierre | Date: | Fri, 02 Jun 2023 12:18:04 +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-120512@lists.php.net to get a copy of this message | ||
Le 02/06/2023 à 10:57, Janusz Szczypka a écrit :
You are right about speed penalty for using those functions over simple loops, however if we would stick to that point of view, we should deprecate and remove array_filter, array_map, array_walk, array_u...I'm not sure they deserve deprecation, but I think that proposal may be the right time to talk about adding a real iterable API in PHP core for every one to use, a complete and consistent one, that would work on all traversable data structures, https://github.com/nikic/iter is perfect in my opinion for a good start, and would really deserve to be in SPL, and maintained along with core, and be usable without any composer dependencies. PHP is really lacking a complete enumerable / iterable / traversable API. Maybe this is time to design and add one ? -- Pierre