Skip to content

Commit

Permalink
bugfix php jit issue with ternary operator
Browse files Browse the repository at this point in the history
see symfony/symfony#54053 for more context
  • Loading branch information
verfriemelt-dot-org authored and nicolas-grekas committed Feb 26, 2024
1 parent 4eda17b commit 0bd342e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Internal/Hydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 0bd342e

Please sign in to comment.