I just came up with the most brutal hack to use array_reduce with short functions ... heh.
Since "add to the array" and "return the array" are two operations, I turned them into a single one by using a ternary:
fn ($carry, $item) =>
($carry[$item['category']] = $item)
Open source. Open community. We are dedicated to building and enriching the PHP community.