From 7044c2cd43f34e8ba70b4e8c7e07e9c86236c16c Mon Sep 17 00:00:00 2001 From: Thomas Lanquetin Date: Fri, 7 Jul 2023 17:37:28 +0200 Subject: [PATCH] fix: increment index to detect associative array --- src/JsonPointer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonPointer.php b/src/JsonPointer.php index 0b950a4..f6bb9b0 100644 --- a/src/JsonPointer.php +++ b/src/JsonPointer.php @@ -285,7 +285,7 @@ public static function remove(&$holder, $pathItems, $flags = 0) if ($flags & self::TOLERATE_ASSOCIATIVE_ARRAYS) { $i = 0; foreach ($parent as $index => $value) { - if ($i !== $index) { + if ($i++ !== $index) { $isAssociative = true; break; }