Skip to content

Commit b9a9d35

Browse files
verfriemelt-dot-orgnicolas-grekas
authored andcommitted
bugfix php jit issue with ternary operator
see #54053 for more context
1 parent 509aa06 commit b9a9d35

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Symfony/Component/VarExporter/Internal/Hydrator.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,19 @@ public static function getPropertyScopes($class)
271271
$name = $property->name;
272272

273273
if (\ReflectionProperty::IS_PRIVATE & $flags) {
274-
$propertyScopes["\0$class\0$name"] = $propertyScopes[$name] = [$class, $name, $flags & \ReflectionProperty::IS_READONLY ? $class : null, $property];
274+
$readonlyScope = null;
275+
if ($flags & \ReflectionProperty::IS_READONLY) {
276+
$readonlyScope = $class;
277+
}
278+
$propertyScopes["\0$class\0$name"] = $propertyScopes[$name] = [$class, $name, $readonlyScope, $property];
279+
275280
continue;
276281
}
277-
$propertyScopes[$name] = [$class, $name, $flags & \ReflectionProperty::IS_READONLY ? $property->class : null, $property];
282+
$readonlyScope = null;
283+
if ($flags & \ReflectionProperty::IS_READONLY) {
284+
$readonlyScope = $property->class;
285+
}
286+
$propertyScopes[$name] = [$class, $name, $readonlyScope, $property];
278287

279288
if (\ReflectionProperty::IS_PROTECTED & $flags) {
280289
$propertyScopes["\0*\0$name"] = $propertyScopes[$name];

0 commit comments

Comments
 (0)