3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function reduce($a, $b) { return $b+$a; } $array = array(1,2,3,4,5,6,7,8,9,0); array_reduce($array, array(null, 'reduce'));
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_reduce() expects parameter 2 to be a valid callback, first array member is not a valid class name or object in /in/hLA1E on line 7
Output for hhvm-3.10.0 - 3.12.0
Warning: array_reduce() expects parameter 2 to be a valid callback in /in/hLA1E on line 7
Output for 5.2.3 - 5.2.17
Warning: array_reduce(): The second argument, 'Array', should be a valid callback in /in/hLA1E on line 7
Output for 4.4.3 - 5.2.2
<br /> <b>Warning</b>: array_reduce() [<a href='function.array-reduce'>function.array-reduce</a>]: The second argument, 'Array', should be a valid callback in <b>/in/hLA1E</b> on line <b>7</b><br />
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: array_reduce(): The second argument, 'Array', should be a valid callback in <b>/in/hLA1E</b> on line <b>7</b><br />
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: array_reduce() [<a href='http://www.php.net/function.array-reduce'>function.array-reduce</a>]: The second argument, 'Array', should be a valid callback in <b>/in/hLA1E</b> on line <b>7</b><br />