// ---- previously -------- class Address { public string $name; public DateTimeImmutable $birthday; public function __construct(string $n, DateTimeImmutable $g) { $this->name = $n; $this->$birthday = $g; } } // ---- in PHP 8 -------- class Address { public function __construct( public string $name, public DateTimeImmutable $birthday, ) {} }