3v4l.org

run code in 500+ PHP versions simultaneously
<?php $foo = null; var_dump($foo?->{print("print\n")});
Output for 8.1.2 - 8.1.34, 8.2.0 - 8.2.35, 8.3.0 - 8.3.36, 8.4.1 - 8.4.27, 8.5.0 - 8.5.12
NULL
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.1
print NULL
Output for 7.4.0 - 7.4.33
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/4tgX7 on line 5
Process exited with code 255.

preferences:
21.52 ms | 1165 KiB | 6 Q