diff --git a/src/PHPHtmlParser/Dom/Node/Collection.php b/src/PHPHtmlParser/Dom/Node/Collection.php index ff447259..17aa031b 100644 --- a/src/PHPHtmlParser/Dom/Node/Collection.php +++ b/src/PHPHtmlParser/Dom/Node/Collection.php @@ -130,9 +130,12 @@ public function offsetUnset($offset): void * * @return mixed */ - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed + { - return $this->collection[$offset] ?? null; + + return $this->collection[$offset] ?? ''; + } /**