- Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- Fatal error: Type of B::$prop must not be defined (as in class A) in /in/s85dt on line 7
Process exited with code 255.
<?php
class A {
public $prop;
}
class B extends A{
public int|string $prop = 1;
}
var_dump((new B())->prop);