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
{{ message }}
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
PHP 7.4 introduces reference reflection, which overall might provide a nicer mechanism for reference detection, but the RFC specifically makes mention of the "mutate array to detect if its a reference" approach that may cease to function correctly. If I remember correctly, this is what phony does internally when rendering arrays.
The text was updated successfully, but these errors were encountered:
I implemented support for the new ReflectionReference API in the exporter, and it actually had some nice side effects, like making array IDs persistent across exporter invocations (which is how objects already worked).
As I suspected, the deep equality logic does similar stuff to what the exporter was doing, like assigning IDs to arrays by setting a special array key. This could probably be replaced with logic that used ReflectionReference too, but I can't see any way that it could possibly be as performant as the current implementation, which continues to work just fine under PHP 7.4. I'm not inclined to change it just yet, for that reason.
@jmalloc The deep equality code was actually your contribution, I think. If I ever have to rewrite it to use the new reference reflection stuff I might have to get your input 😅
PHP 7.4 introduces reference reflection, which overall might provide a nicer mechanism for reference detection, but the RFC specifically makes mention of the "mutate array to detect if its a reference" approach that may cease to function correctly. If I remember correctly, this is what phony does internally when rendering arrays.
The text was updated successfully, but these errors were encountered: