- 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/8ig6M on line 4
Process exited with code 255.
<?php
class MyParent {
public string $myProp { get => "foo"; set { var_dump('setter'); } }
}
class MyChild extends MyParent {
public string $myProp { get => "foo"; }
}
$p = new MyChild;
$p->myProp = "lol";
var_dump($p);
$p = new MyParent;
$p->myProp = "lol";
var_dump($p);