3v4l.org

run code in 300+ PHP versions simultaneously
<?php function counter($start, &$stop){ if ($stop > $start){ return; } counter($start-- , ++$stop); } $start = 5; $stop = 2; counter($start,$stop);
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught Error: counter(): Argument #2 ($stop) could not be passed by reference in /in/EN6f5:7 Stack trace: #0 /in/EN6f5(12): counter(4, 3) #1 {main} thrown in /in/EN6f5 on line 7
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught Error: counter(): Argument #2 ($stop) cannot be passed by reference in /in/EN6f5:7 Stack trace: #0 /in/EN6f5(12): counter(4, 3) #1 {main} thrown in /in/EN6f5 on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Only variables should be passed by reference in /in/EN6f5 on line 7 Notice: Only variables should be passed by reference in /in/EN6f5 on line 7 Notice: Only variables should be passed by reference in /in/EN6f5 on line 7 Notice: Only variables should be passed by reference in /in/EN6f5 on line 7
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.3.32 - 7.3.33

preferences:
157.17 ms | 402 KiB | 273 Q