From 064710324e11a895c2c6935315090eba4f79dde8 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 26 Apr 2023 15:41:56 +0900 Subject: [PATCH] Bug fix in arraySearchKey path reset --- src/Combined/ArrayHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Combined/ArrayHandler.php b/src/Combined/ArrayHandler.php index 8619f34..a7cb5f1 100644 --- a/src/Combined/ArrayHandler.php +++ b/src/Combined/ArrayHandler.php @@ -208,7 +208,9 @@ class ArrayHandler $prev_depth = 0; foreach ($recursive as $key => $value) { if ($prev_depth > $recursive->getDepth()) { - $key_path = []; + // remove all trailing to ne depth + $diff = $prev_depth - $recursive->getDepth(); + array_splice($key_path, -$diff, $diff); } $prev_depth = $recursive->getDepth(); if ($flat === false) {