Skip to content

Commit 98acd14

Browse files
committed
Rewind is_first_key_operator() param before checking key
1 parent 6590854 commit 98acd14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/functions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ function is_first_key_operator($document)
7777
throw InvalidArgumentException::invalidType('$document', $document, 'array or object');
7878
}
7979

80+
reset($document);
8081
$firstKey = (string) key($document);
8182

82-
return (isset($firstKey[0]) && $firstKey[0] == '$');
83+
return (isset($firstKey[0]) && $firstKey[0] === '$');
8384
}
8485

8586
/**

0 commit comments

Comments
 (0)