Problem Statement
What does the nullsafe operator ( ?-> ) do in PHP 8?
Explanation
The nullsafe operator prevents runtime errors when accessing methods or properties on null objects by returning null instead of throwing an error.
Code Solution
SolutionRead Only
$user?->getProfile()?->getName();
