3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fib($n) { if($n < 2) { return 1; } return fib($n - 2) + fib(n - 1); } echo fib(5);
Output for 7.2.0
Warning: Use of undefined constant n - assumed 'n' (this will throw an Error in a future version of PHP) in /in/UBrHU on line 9 Warning: A non-numeric value encountered in /in/UBrHU on line 9 Warning: Use of undefined constant n - assumed 'n' (this will throw an Error in a future version of PHP) in /in/UBrHU on line 9 Warning: A non-numeric value encountered in /in/UBrHU on line 9 3
Output for 7.1.0 - 7.1.10
Notice: Use of undefined constant n - assumed 'n' in /in/UBrHU on line 9 Warning: A non-numeric value encountered in /in/UBrHU on line 9 Notice: Use of undefined constant n - assumed 'n' in /in/UBrHU on line 9 Warning: A non-numeric value encountered in /in/UBrHU on line 9 3
Output for 5.3.19 - 7.0.20
Notice: Use of undefined constant n - assumed 'n' in /in/UBrHU on line 9 Notice: Use of undefined constant n - assumed 'n' in /in/UBrHU on line 9 3