You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, when PHP 7.4 is used, we can replace the current implementation by one based on ReflectionReference. That would make things both cleaner and compatible with typed-references.
While this might not be the most trivial part of the code to have a look at, the ETA of PHP 7.4 is early December. Anyone would like to give it a try?
The text was updated successfully, but these errors were encountered:
…key is a reference (php >= 7.4) (dorumd, nicolas-grekas)
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] Use \ReflectionReference for determining if a key is a reference (php >= 7.4)
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31135
| License | MIT
| Doc PR | -
Prepare for PHP 7.4: use ReflectionReference in VarCloner
Commits
-------
40f24ef [VarDumper] finish PHP 7.4 support and add tests
e99a6b8 [VarDumper] Use \ReflectionReference for determining if a key is a reference (php >= 7.4)
In VarDumper's
VarCloner
, we use some black magic tricks to work with PHP references (called "hard references" in the code, i.e.$b = &$a
).In PHP 7.4, this will break with typed properties, because of the
$cookie
trick that is used to detect these references.But PHP 7.4 has a solution:
ReflectionReference
So, when PHP 7.4 is used, we can replace the current implementation by one based on
ReflectionReference
. That would make things both cleaner and compatible with typed-references.While this might not be the most trivial part of the code to have a look at, the ETA of PHP 7.4 is early December. Anyone would like to give it a try?
The text was updated successfully, but these errors were encountered: