<?php class Foo { public ?string $prop = null; public function __construct(?string $prop = null) { $this->prop = $prop; } } class Bar extends Foo { public function __construct( public ?string $bar = null, ) {} } // Echoes nothing, but it works as expected. echo (new Bar())->prop;
You have javascript disabled. You will not be able to edit any code.