// ---- previously -------- if ($user !== null) { $a = $user->address; if ($a !== null) { $b = $user->getBirthday(); if ($b !== null) { $bday = $b->asString(); } } } // ---- in PHP 8 -------- $bdate = $user?->address?->getBirthday()?->asString();