3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function f($number) { $num=fib($number); echo ' | '.$number.' number fibinache is '.$num; } function fib($num,$count=0,$plast=0,$last=1){ if($count++ < $num){ $newlast=$plast+$last; echo ' | '.$count.': '.$newlast; //$count; return fib($num,$count,$last,$newlast); } else { return $last; } } f(10); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
| 1: 1 | 2: 2 | 3: 3 | 4: 5 | 5: 8 | 6: 13 | 7: 21 | 8: 34 | 9: 55 | 10: 89 | 10 number fibinache is 89