Skip to content

Commit 34b4d41

Browse files
committed
checking non-existent property
1 parent c06cd77 commit 34b4d41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/JsonDiff.php

+4
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ private function rearrangeArray(array $original, array $new)
223223
if (!$item instanceof \stdClass) {
224224
return $new;
225225
}
226+
if (!isset($item->$key)) {
227+
$keyIsUnique = false;
228+
break;
229+
}
226230
$value = $item->$key;
227231
if ($value instanceof \stdClass || is_array($value)) {
228232
$keyIsUnique = false;

0 commit comments

Comments
 (0)