<?php declare(strict_types=1); error_reporting(E_ALL); class foo {} class bar { public function __construct(public foo $foo = new foo()) {} } $bar = new bar(); var_dump($bar->foo);
You have javascript disabled. You will not be able to edit any code.