diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index c1ce405437dd..78606db626d2 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -592,7 +592,7 @@ private function isAllowedProperty(string $class, string $property): bool try { $reflectionProperty = new \ReflectionProperty($class, $property); - return $reflectionProperty->getModifiers() & $this->propertyReflectionFlags; + return (bool) ($reflectionProperty->getModifiers() & $this->propertyReflectionFlags); } catch (\ReflectionException $e) { // Return false if the property doesn't exist }