TIL Optional Chaining in PHP8
POSTED ON:
Hot dog!
This is totally legit in php now.
$country = $session?->user?->getAddress()?->country;
It looks like this:
const countryAddress = session?.user?.getAddress()
const country = countryAddress['country']
REFERENCE:
PHP 8 features I wish also existed in JavaScript
Related TILs
Tagged: php