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.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
Output for 8.1.34, 8.2.0 - 8.2.31
Parse error: syntax error, unexpected token "public", expecting "=" in /in/XYmck on line 8
Process exited with code 255.

preferences:
52.39 ms | 862 KiB | 4 Q