3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; array_push((array) $array, 'test'); var_export($array);
Output for 8.3.0 - 8.3.7
Fatal error: Uncaught Error: array_push(): Argument #1 ($array) could not be passed by reference in /in/ULpOJ:5 Stack trace: #0 {main} thrown in /in/ULpOJ on line 5
Process exited with code 255.
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19
Fatal error: Uncaught Error: array_push(): Argument #1 ($array) cannot be passed by reference in /in/ULpOJ:5 Stack trace: #0 {main} thrown in /in/ULpOJ on line 5
Process exited with code 255.
Output for 7.3.14, 7.4.9 - 7.4.33
Fatal error: Only variables can be passed by reference in /in/ULpOJ on line 5
Process exited with code 255.

preferences:
72.51 ms | 402 KiB | 94 Q