diff --git a/src/ArrayComparator.php b/src/ArrayComparator.php index 33147979..35a83e07 100644 --- a/src/ArrayComparator.php +++ b/src/ArrayComparator.php @@ -134,11 +134,5 @@ private function canonicalize(array &$array): void } else { ksort($array); } - - foreach ($array as &$element) { - if (is_array($element)) { - $this->canonicalize($element); - } - } } } diff --git a/tests/ArrayComparatorTest.php b/tests/ArrayComparatorTest.php index 2828e6b5..0534ed2c 100644 --- a/tests/ArrayComparatorTest.php +++ b/tests/ArrayComparatorTest.php @@ -71,8 +71,8 @@ public static function assertEqualsSucceedsProvider() [true], ], [ - ['a', 'b' => [1, 2]], - ['b' => [2, 1], 'a'], + ['a', 'b' => [1, 2], 'c' => [1, 2, 'd' => [1, 2]]], + ['c' => [1, 'd' => [2, 1], 2], 'b' => [2, 1], 'a'], 0, true, ],