Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Removed ZEND_IS_XDIGIT() #18926

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

Merged
merged 1 commit into from
Jun 24, 2025
Merged

Conversation

SakiTakamachi
Copy link
Member

This macro cannot correctly determine whether a string is a valid hexadecimal unless used together with ZEND_IS_DIGIT().

In practice, it is not used anywhere within php-src, and its name does not reflect its actual behavior, so I propose removing it.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

@SakiTakamachi
Copy link
Member Author

SakiTakamachi commented Jun 24, 2025

@Girgias

It appears to have been around since 2006.

ff9d0fc#diff-8e51ab7f9c143d49351a9e71d73cdab8b84ef38d3a456194c2ee741d8c39703dR79

@Girgias
Copy link
Member

Girgias commented Jun 24, 2025

@Girgias

It appears to have been around since 2006.

ff9d0fc#diff-8e51ab7f9c143d49351a9e71d73cdab8b84ef38d3a456194c2ee741d8c39703dR79

Right, but the support of Hexadecimal numeric strings was removed in 7.0, and the commit references an optimization for that behaviour. :)

@SakiTakamachi
Copy link
Member Author

@Girgias

Ah! I see, I misunderstood.
It does seem to be a remnant of the RFC you mentioned.

@SakiTakamachi SakiTakamachi marked this pull request as ready for review June 24, 2025 11:32
@SakiTakamachi SakiTakamachi merged commit 537ae4f into php:master Jun 24, 2025
9 checks passed
@SakiTakamachi SakiTakamachi deleted the remove_zend_is_xdigit branch June 24, 2025 11:40
@nielsdos
Copy link
Member

nielsdos commented Jun 24, 2025

Third party extensions may use this (e.g. protobuf), why not fix the macro instead?

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.

3 participants