3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { const __dir__ = 'C'; } use A\__dir__; echo __dir__;
Output for 8.1.23 - 8.1.29, 8.2.10 - 8.2.23, 8.3.0 - 8.3.11
/in
Output for 7.0.0 - 7.0.17, 7.1.0 - 7.1.3
Parse error: syntax error, unexpected '__dir__' (T_DIR), expecting identifier (T_STRING) or '{' in /in/ndn9b on line 7
Process exited with code 255.

preferences:
63.28 ms | 407 KiB | 5 Q