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 < 20; ++$i) { print(fib($i) . "\n"); }
based on 77k9B
Output for 4.3.0 - 7.2.0
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181