From b9a9d35be19710120a83f975adde4139ab0f3c04 Mon Sep 17 00:00:00 2001 From: Richard Heine Date: Sun, 25 Feb 2024 22:17:43 +0100 Subject: [PATCH] bugfix php jit issue with ternary operator see https://github.com/symfony/symfony/issues/54053 for more context --- .../Component/VarExporter/Internal/Hydrator.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/VarExporter/Internal/Hydrator.php b/src/Symfony/Component/VarExporter/Internal/Hydrator.php index d792aa5e9b436..49d636fb8e0ce 100644 --- a/src/Symfony/Component/VarExporter/Internal/Hydrator.php +++ b/src/Symfony/Component/VarExporter/Internal/Hydrator.php @@ -271,10 +271,19 @@ public static function getPropertyScopes($class) $name = $property->name; if (\ReflectionProperty::IS_PRIVATE & $flags) { - $propertyScopes["\0$class\0$name"] = $propertyScopes[$name] = [$class, $name, $flags & \ReflectionProperty::IS_READONLY ? $class : null, $property]; + $readonlyScope = null; + if ($flags & \ReflectionProperty::IS_READONLY) { + $readonlyScope = $class; + } + $propertyScopes["\0$class\0$name"] = $propertyScopes[$name] = [$class, $name, $readonlyScope, $property]; + continue; } - $propertyScopes[$name] = [$class, $name, $flags & \ReflectionProperty::IS_READONLY ? $property->class : null, $property]; + $readonlyScope = null; + if ($flags & \ReflectionProperty::IS_READONLY) { + $readonlyScope = $property->class; + } + $propertyScopes[$name] = [$class, $name, $readonlyScope, $property]; if (\ReflectionProperty::IS_PROTECTED & $flags) { $propertyScopes["\0*\0$name"] = $propertyScopes[$name];