Personally, I'm a big fan of the ?? syntax (available from PHP 7 and up).
An example:
<?php// Long syntax!empty($book->author->name)?$book->author->name:'no known author'// Short syntax with the coalescing operator$book->author->name??'no known author'// Chaining ?? can tidy up your views (arbitrary example here)Hello,<?=$user->nickname??$user->name??'stranger'?>
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Personally, I'm a big fan of the ?? syntax (available from PHP 7 and up).
An example: