3v4l.org

run code in 500+ PHP versions simultaneously
<?php const DefaultX = new X(); class X { public const D = DefaultX; public int $n = 5; }
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.6
Fatal error: Uncaught Error: Undefined constant "DefaultX" in /in/MeXTR:4 Stack trace: #0 {main} thrown in /in/MeXTR on line 4
Process exited with code 255.

preferences:
28.48 ms | 851 KiB | 4 Q