Is there any way of checking if a variable is not null and then to check if variable has nested associative array keys using a shorthand? Something like optional chaining for associative arrays?

Example of what I would like to make concise:

```
public $arr;

//$arr gets set as an associative array somewhere else in the code.

function someFunc() {
   if ($this->arr && $this->arr['key1'] && $this->arr['key1']['key2'] == 'Some Value') { // shorten this line?
      // Do Something Cool!
   }
}

```

I am looking for something similar to Optional Chaining in Javascript e.g. :

```
if (obj.key1?.key2 == 'Some Value') { 
    // Do something kool
}

```

There is a high probability that this is a duplicate and I apologize in advance if that is the case. I tried searching for this for associative arrays and could not find anything specific.