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 ( empty($arr) ) { return; } return $arr[0] + sum(array_slice($arr,1)); } $a = array(5,4,7,8,9,3); echo sum($a);
Output for 5.3.7 - 7.1.0
36