2 /* Prototype : mixed array_reduce(array input, mixed callback [, int initial])
3 * Description: Iteratively reduce the array to a single value via the callback.
4 * Source code: ext/standard/array.c
8 echo "*** Testing array_reduce() : variation - object callbacks ***\n";
11 static function adder($a, $b) {return $a +
$b;}
12 public function adder2($a, $b) {return $a +
$b;}
17 echo "\n--- Static method callback ---\n";
18 var_dump(array_reduce($array, array("A", "adder")));
20 echo "\n--- Instance method callback ---\n";
21 var_dump(array_reduce($array, array(new A(), "adder2")));