Skip to content

Commit

Permalink
bug #54054 [VarExporter] Bugfix/workaround jit issue (verfriemelt-dot…
Browse files Browse the repository at this point in the history
…-org)

This PR was merged into the 6.4 branch.

Discussion
----------

[VarExporter] Bugfix/workaround jit issue

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fixes/Workaround for #54053
| License       | MIT

I managed to fix the erratically behavior with this patch, but i have no idea how one would test this.
It seems tracing jit has some issues with the ternary operator.

Let me know what you think, i have no idea how to work with that properly :)

Commits
-------

b9a9d35 bugfix php jit issue with ternary operator
  • Loading branch information
nicolas-grekas committed Feb 26, 2024
2 parents 8ec8741 + b9a9d35 commit 2e4de58
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Symfony/Component/VarExporter/Internal/Hydrator.php
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 2e4de58

Please sign in to comment.