3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /*function rev($str) { if ( ! $str ) { return; } return rev(substr($str,1)) . $str{0}; }*/ function sum($arr) { if ( ! is_array($arr) ) { return $arr[0]; } return sum(array_shift($arr)); } $a = array(5,4,7,8,9,3); echo sum($a);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0