3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function fantastic3($n) { $a=array(); $a[0]=0; $a[1]=1; $a[2]=1; for($i=3;$i<=$n;$i++){ $a[$i]=$a[$i-1]+$a[$i-2]+$a[$i-3]-1; } return $a[$n-1]; } echo fantastic3(); ?>
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function fantastic3(), 0 passed in /in/Xij9g on line 17 and exactly 1 expected in /in/Xij9g:3 Stack trace: #0 /in/Xij9g(17): fantastic3() #1 {main} thrown in /in/Xij9g on line 3
Process exited with code 255.
Output for 5.3.0 - 7.0.14
Warning: Missing argument 1 for fantastic3(), called in /in/Xij9g on line 17 and defined in /in/Xij9g on line 3 Notice: Undefined variable: n in /in/Xij9g on line 9 Notice: Undefined variable: n in /in/Xij9g on line 13 Notice: Undefined offset: -1 in /in/Xij9g on line 13
Output for 5.1.0 - 5.2.17
Warning: Missing argument 1 for fantastic3(), called in /in/Xij9g on line 17 and defined in /in/Xij9g on line 3 Notice: Undefined variable: n in /in/Xij9g on line 9 Notice: Undefined variable: n in /in/Xij9g on line 13 Notice: Undefined offset: -1 in /in/Xij9g on line 13
Output for 4.3.0 - 5.0.5
Warning: Missing argument 1 for fantastic3() in /in/Xij9g on line 3 Notice: Undefined offset: -1 in /in/Xij9g on line 13