Skip to content

Commit c5c851f

Browse files
[PropertyAccess] Fix on PHP < 7.4
1 parent f840e4a commit c5c851f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ private function readProperty(array $zval, string $property, bool $ignoreInvalid
470470
throw $e;
471471
}
472472
} elseif (PropertyReadInfo::TYPE_PROPERTY === $type) {
473-
if (!method_exists($object, '__get') && !\array_key_exists($name, (array) $object) && !(new \ReflectionProperty($class, $name))->hasType()) {
473+
if (!method_exists($object, '__get') && !\array_key_exists($name, (array) $object) && (\PHP_VERSION_ID < 70400 || !(new \ReflectionProperty($class, $name))->hasType())) {
474474
throw new UninitializedPropertyException(sprintf('The property "%s::$%s" is not initialized.', $class, $name));
475475
}
476476

0 commit comments

Comments
 (0)