$user = null; echo $user->address->country ?? ''; PHPã®ããããã£ã¯å ããnullå®å ¨ãªã®ã§ãåå¨ããªãããããã£ã ãããnullã ãããããªããã£ãåã ããããããªãããããã£ãåãåºãã¾ãã åããªãå ´åã¯E_NOTICEãçºçãã¾ããã??ã使ãã°é»æ®ºã§ãã¾ãã ãããã¡ã½ããã¯ã ãã§ãã echo $user->getAddress()->getCountry() ?? ''; // Fatal error: Call to a member function getAddress() // 1 if (method_exists($user, 'getAddress')) { if (method_exists($user->getAddress(), 'getCountry')) { echo $user->getAddres
{{#tags}}- {{label}}
{{/tags}}