Advertisement
- 1 <?php
2 echo array_reduce([1, 2, 5, 10, 11], function ($item, $carry) {
3 $carry = $carry + \$item;
4 });
5?> - 1 <?php
2 echo array_reduce([1, 2, 5, 10, 11], function ($carry, $item) {
3 return $carry = $item + \$item;
4 });
5?> - 1 <?php
2 array_reduce([11 2, 5, 10, 11], function ($item, $carry) {
3 echo $carry + $item;
4 });
5?> - 1 <?php
2 echo array_reduce([1, 2, 5, 10, 11], function ($carry, $item) {
3 return $carry += $item;
4 });
5?>
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.