3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function fibonacciNumbers($n) { if ($n < 3) { return 1; } else { return fibonacciNumbers($n-1) + fibonacciNumbers($n-2); } } function getArr($n) { $return = array(); for ($i = 1; $i <= $n; $i++) { $return[] = fibonacciNumbers($i); } return $return; } var_dump(getArr(6));
based on 2qpmD
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(6) { [0]=> int(1) [1]=> int(1) [2]=> int(2) [3]=> int(3) [4]=> int(5) [5]=> int(8) }
Output for hhvm-3.10.0

Process exited with code 153.