3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f1(&$v) {} function f2() {$a = array(1,2,3); return $a; } f1((bool)f2());
Output for 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Uncaught Error: f1(): Argument #1 ($v) could not be passed by reference in /in/J4Q8e:5 Stack trace: #0 {main} thrown in /in/J4Q8e on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29
Fatal error: Uncaught Error: f1(): Argument #1 ($v) cannot be passed by reference in /in/J4Q8e:5 Stack trace: #0 {main} thrown in /in/J4Q8e on line 5
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Only variables can be passed by reference in /in/J4Q8e on line 5
Process exited with code 255.

preferences:
85.59 ms | 410 KiB | 5 Q