3v4l.org

run code in 500+ 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.32, 8.3.5 - 8.3.32, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
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:
57.42 ms | 794 KiB | 4 Q