|
|
|
|
|
by Scriptor
4630 days ago
|
|
PHP does have array_reduce, however operators like '+' can't be used as callables so you'd have to make your own wrapper functions. Edit: Screw it, haven't self promoted on a while. In Pharen (https://github.com/scriptor/pharen), which compiles to PHP, you could do: (reduce (+) 0 [1 2 3 4 5])
|
|