Null safe operator for class in PHP

The null safe operator (?->) in PHP is a feature introduced in PHP 8.0. It allows you to call methods or access properties on an object only if the object…