3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyC { const name = "OK"; } echo "${MyC->name}";
Output for 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Using ${expr} (variable variables) in strings is deprecated, use {${expr}} instead in /in/A2VSJ on line 8 Fatal error: Uncaught Error: Undefined constant "MyC" in /in/A2VSJ:8 Stack trace: #0 {main} thrown in /in/A2VSJ on line 8
Process exited with code 255.
Output for 8.1.23 - 8.1.28
Fatal error: Uncaught Error: Undefined constant "MyC" in /in/A2VSJ:8 Stack trace: #0 {main} thrown in /in/A2VSJ on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/A2VSJ on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/A2VSJ on line 8
Process exited with code 255.

preferences:
91.89 ms | 401 KiB | 83 Q