3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func(&$var) { } func(1);
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Error: func(): Argument #1 ($var) could not be passed by reference in /in/S2ZX7:6 Stack trace: #0 {main} thrown in /in/S2ZX7 on line 6
Process exited with code 255.
Output for 8.1.23 - 8.1.34, 8.2.10 - 8.2.30
Fatal error: Uncaught Error: func(): Argument #1 ($var) cannot be passed by reference in /in/S2ZX7:6 Stack trace: #0 {main} thrown in /in/S2ZX7 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19
Fatal error: Only variables can be passed by reference in /in/S2ZX7 on line 6
Process exited with code 255.

preferences:
35.44 ms | 1062 KiB | 4 Q