array_reduce() To Filter And Alter

no-email (Rahul Chavan), Rahul Chavan
Sat, 03 Feb 2024 00:00:00 +0000

Using array_reduce() to create custom data structures goes beyond simple filtering.
array_reduce() might save a second loop. Although, it might also be quite slow, in particular for large arrays (10 millions+).
array_reduce() doesn't provide keys when processing them.