3v4l.org

run code in 300+ PHP versions simultaneously
<?php // PHP Program to Generate // Fibonacci Series function fibonacciSeries($n){ $num1 = 0; $num2 = 1; for ( $i = 0; $i < $n; $i++ ) { echo $num1 . ", "; $num3 = $num1 + $num2; $num1 = $num2; $num2 = $num3; } } // Driver Code $n = 10; fibonacciSeries($n); ?><?php // PHP Program to Generate // Fibonacci Series function fibonacciSeries($n){ $num1 = 0; $num2 = 1; for ( $i = 0; $i < $n; $i++ ) { echo $num1 . ", "; $num3 = $num1 + $num2; $num1 = $num2; $num2 = $num3; } } // Driver Code $n = 10; fibonacciSeries($n); ?>
Output for 8.4.1
Fatal error: Cannot redeclare function fibonacciSeries() (previously declared in /in/Yi2WB:5) in /in/Yi2WB on line 25
Process exited with code 255.
Output for 8.2.0 - 8.2.5, 8.2.26, 8.3.14
Fatal error: Cannot redeclare fibonacciSeries() (previously declared in /in/Yi2WB:5) in /in/Yi2WB on line 25
Process exited with code 255.
Output for 8.2.6 - 8.2.25, 8.3.0 - 8.3.13
Fatal error: Cannot redeclare fibonacciSeries() (previously declared in /in/Yi2WB:5) in /in/Yi2WB on line 29
Process exited with code 255.

preferences:
148.14 ms | 1460 KiB | 7 Q