<?php
$list = [
['number' => 3],
['number' => 2],
['number' => 45],
];
// 1st example
echo array_sum(array_column($list, 'number')), PHP_EOL;
// 2nd example
echo array_reduce($list, function ($carry, $item) {
return $carry += $item['number'];
}), PHP_EOL;
// 3rd example
array_walk($list, function ($item) use (&$sum) {
$sum += $item['number'];
});
echo $sum, PHP_EOL;
// 4th example
array_map(function ($item) use (&$sum2) {
$sum2 += $item['number'];
}, $list);
echo $sum2, PHP_EOL;
https://ideone.com/xSbmOX