3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = []; array_push((array) $array, 'test'); var_export($array);
Output for 8.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.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.34, 8.2.0 - 8.2.31
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:
92.19 ms | 1166 KiB | 4 Q