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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php