3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function sum($carry, $item) { echo $carry."==".$item; exit; $carry += $item; return $carry; } $a = array(1, 2, 3, 4, 5); var_dump(array_reduce($a, "sum"));
Output for 4.3.3 - 7.1.0
==1
Output for 4.3.0 - 4.3.2
1==2