From 24f31febf4dd1578b6be3e59deaeb46f73254077 Mon Sep 17 00:00:00 2001 From: Aref <93086624+isAref@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:39:19 +0430 Subject: [PATCH] Update Collection.php Bug fix in php 8.1 --- src/PHPHtmlParser/Dom/Node/Collection.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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] ?? ''; + } /**