Skip to content

Commit d4f3f37

Browse files
authored
Merge pull request #4 from revinate/php7.4-compat
Fixing ArrayAccess comparison
2 parents a72b9b9 + 9ddb339 commit d4f3f37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/getValueFunctions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function getValue($doc, $fieldName, $default = null) {
4141
return isset($doc[$fieldName]) || array_key_exists($fieldName, $doc) ? $doc[$fieldName] : $default;
4242
}
4343
if ($doc instanceof ArrayAccess) {
44-
return isset($doc[$fieldName]) || property_exists($doc, $fieldName) ? $doc[$fieldName] : $default;
44+
return isset($doc[$fieldName]) || $doc->offsetExists($fieldName) ? $doc[$fieldName] : $default;
4545
}
4646
if (is_object($doc)) {
4747
if (isset($doc->{$fieldName})) {

0 commit comments

Comments
 (0)