3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fib($num) { if ($num === 1) { return 1; } elseif ($num === 2) { return 1; } return fib($num-2) + fib($num-1); } for($i = 1; $i < 10; ++$i) { print(fib($i) . "\n"); }
Output for 4.3.0 - 7.2.0
1 1 2 3 5 8 13 21 34