3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fibonacci($n,$first = 0,$second = 1) { $fib = [$first,$second]; for($i=1;$i<$n;$i++) { $fib[] = $fib[$i]+$fib[$i-1]; } return array_pop($fib); } echo fibonacci(40);
based on nZYAL
Output for 5.4.2 - 7.2.0
102334155
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/NTk9q on line 5
Process exited with code 255.