3v4l.org

run code in 300+ PHP versions simultaneously
<?php $type = gettype(1.456); $var = settype(1.456, $type); echo gettype($var);
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught Error: settype(): Argument #1 ($var) could not be passed by reference in /in/7q5vD:3 Stack trace: #0 {main} thrown in /in/7q5vD on line 3
Process exited with code 255.
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18
Fatal error: Uncaught Error: settype(): Argument #1 ($var) cannot be passed by reference in /in/7q5vD:3 Stack trace: #0 {main} thrown in /in/7q5vD on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.26, 5.4.0 - 5.4.16
Fatal error: Only variables can be passed by reference in /in/7q5vD on line 3
Process exited with code 255.

preferences:
86.56 ms | 402 KiB | 71 Q