-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Introduce ReflectionProperty::getMangledName() #18605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This follows the normal mangling scheme for properties. Emitting a warning is not useful, because you can't really prevent it, and the code is not wrong. You need to change the way you access protected properties in an array created from an object to array cast. |
I'm assuming this is related to the suggestion in #18600 (comment). One thing that would be possible is providing something like |
|
I agree. I retargeted the issue therefore to the introduction of such a method. |
This issue is about renamed keys when casting array to object/stdClass. (3rd and 4th dump in [repro]) -> here I would not speak about any "mangling" The -> here the result follow the property mangled names [repro] https://3v4l.org/2pnIb |
There is no issue in your code. Property mangling is a feature that prevents naming collisions between properties with different visibilities. You need to use the mangled name when accessing values our of the properties hash table. This behavior is decades old (PHP 5.0). |
(I have update my post above what I consider "mangling" and what not) |
Description
repro: https://3v4l.org/2pnIb
Because the properties are renamed.
The text was updated successfully, but these errors were encountered: