diff --git a/src/Key.php b/src/Key.php index 95c6310..1ab64e1 100644 --- a/src/Key.php +++ b/src/Key.php @@ -58,14 +58,14 @@ public static function resolveParentKey(string|null $parentKey, string $key): st $parentKeyPieces = explode('_', $parentKey); while (count($parentKeyPieces) > 1) { - array_pop($parentKeyPieces); - $potentialParentKey = implode('_', $parentKeyPieces); $potentialKey = $potentialParentKey . '_' . $key; if (array_key_exists($potentialKey, self::$keys)) { return $potentialParentKey; } + + array_pop($parentKeyPieces); } return $parentKey;