3v4l.org

run code in 500+ PHP versions simultaneously
<?php // relaxed syntax is not possible with constants // const PROTECTED = 'instanity'; class x { // relaxed syntax is possible with class constants private const string public = 'protected'; }
Output for 8.1.34, 8.2.0 - 8.2.34
Parse error: syntax error, unexpected token "public", expecting "=" in /in/XYmck on line 8
Process exited with code 255.
Output for 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11

preferences:
28.43 ms | 1155 KiB | 9 Q