Skip to content

Add ReflectionProperty::getMangledName() #18980

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexandre-daubois
Copy link
Contributor

@alexandre-daubois alexandre-daubois commented Jun 30, 2025

Fix #18605

Good news is that we'll be able to leverage this in the next version of Symfony.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! The implementation looks correct. You may want to avoid printing the mangled name directly in the test, given that it will make the file appear as a binary file. Maybe print the hex value instead, or replace the special chars (i.e. \0 to \\0).

@alexandre-daubois alexandre-daubois force-pushed the props-mangling branch 2 times, most recently from 9022201 to 5dd71d0 Compare June 30, 2025 13:46
@alexandre-daubois
Copy link
Contributor Author

replace the special chars (i.e. \0 to \0)

Nice idea! PR updated, thanks!

@TimWolla
Copy link
Member

TimWolla commented Jul 1, 2025

FWIW: The test format also supports the %0 placeholder for this purpose:

'%0' => '\x00',

@alexandre-daubois
Copy link
Contributor Author

I tried to swap for %0 but the tests fail. I can try to spend more time on it if you think it should really be used 🙂 Both ways suit me

@iluuu1994
Copy link
Member

Maybe you forgot to switch to EXPECTF?

@alexandre-daubois
Copy link
Contributor Author

Exactly this 🤦 Thank you!

@iluuu1994
Copy link
Member

Thanks! LGTM. Waiting on @DanielEScherzer's review as reflection maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce ReflectionProperty::getMangledName()
3 participants