Handle unset keys

This commit is contained in:
Andrea Marco Sartori 2022-11-06 01:06:49 +10:00
parent c32080c344
commit f08fff6f54

View File

@ -90,7 +90,9 @@ class Tree implements IteratorAggregate
*/
public function inObject(): bool
{
return is_string($this->original[$this->depth]);
$key = $this->original[$this->depth] ?? null;
return is_string($key);
}
/**