>
> Better map/filter/reduce primitives in PHP would be dandy, but they have
> nothing to do with array grouping. They're a separate operation that should
> be composed with grouping. Packing them all into a single function sounds
> like a terrible idea.
>
> If we wanted that... that's called list comprehensions, which I would
> support and even tried to rally support for a few years ago, but got met
> with a big shrug. :-)

We can imagine that `array_group` is just a shortcut to:

do grouping, and then do reducing. (common to me)

OR:
do filtering, then do grouping, and the last do reducing. (less common to me)

OR:
do sorting, then do filtering, then do grouping, and the last do reducing.

Best Regards
Hendra Gunawan.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to