3v4l.org

run code in 300+ PHP versions simultaneously
<?php function byRef(& $param){ } readonly class A { public int $prop; } $a = new A; byRef($a->prop);
Output for 8.2.6 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Error: Cannot indirectly modify readonly property A::$prop in /in/22u5X:11 Stack trace: #0 {main} thrown in /in/22u5X on line 11
Process exited with code 255.
Output for 8.1.30 - 8.1.34
Parse error: syntax error, unexpected token "readonly", expecting end of file in /in/22u5X on line 7
Process exited with code 255.

preferences:
56.62 ms | 748 KiB | 4 Q