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:
```phparray_reduce( $items, fn ($carry, $item) => ($carry[$item['category']] = $item) ? $carry : $carry, );```
Maybe there's a way to do this same thing with array_* functions, but nothing came to mind.
Open source. Open community. We are dedicated to building and enriching the PHP community.