3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParent { public string $myProp { get => "foo"; } } class MyChild extends MyParent { public string $myProp { get => "foo"; set {} } } $p = new MyParent; $p->myProp = "lol";
Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.22, 8.3.0 - 8.3.10
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/b2LS3 on line 4
Process exited with code 255.

preferences:
157.7 ms | 1443 KiB | 7 Q