3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function multiplication($carry, $item) { $carry *= $item; return $carry; } $a = array(1, 2, 3, 4, 5); var_dump(array_reduce($a, "sum"));
Output for 5.3.0 - 7.1.0
Warning: array_reduce() expects parameter 2 to be a valid callback, function 'sum' not found or invalid function name in /in/skIK5 on line 10 NULL
Output for 4.3.2 - 5.2.17
Warning: array_reduce(): The second argument, 'sum', should be a valid callback in /in/skIK5 on line 10 NULL
Output for 4.3.0 - 4.3.1
Warning: array_reduce() [http://www.php.net/function.array-reduce]: The second argument, 'sum', should be a valid callback in /in/skIK5 on line 10 NULL