From 8c9f9313668a01df545d4ca5e755a742427f2637 Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Sat, 5 Feb 2022 22:34:09 -0600 Subject: [PATCH] Prevent a warning from being printed in some situations in XPathResult --- lib/XPathResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/XPathResult.php b/lib/XPathResult.php index 4439c07..7b6a89e 100644 --- a/lib/XPathResult.php +++ b/lib/XPathResult.php @@ -133,7 +133,7 @@ class XPathResult implements \ArrayAccess, \Countable, \Iterator { public function offsetGet($offset): ?Node { $this->validateStorage(); - $node = $this->storage[$this->position]; + $node = $this->storage[$offset]; return ($node !== null) ? $node->ownerDocument->getWrapperNode($node) : null; }