Skip to content
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

Revert "Remove name field from the zend_constant struct (#10954)" #11604

Merged
merged 1 commit into from Jul 17, 2023

Conversation

iluuu1994
Copy link
Member

This reverts commit f42992f.

@@ -1500,7 +1500,12 @@ ZEND_FUNCTION(get_defined_constants)
} ZEND_HASH_FOREACH_END();
module_names[i] = "user";

ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(zend_constants), const_name, val) {
ZEND_HASH_MAP_FOREACH_PTR(EG(zend_constants), val) {
if (!val->name) {
Copy link
Member

Choose a reason for hiding this comment

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

IIRC even special constants have a name, so this condition (and the one below) are a no-op

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably, but let's fix that in a separate PR as this is a clean revert.

Copy link
Member

Choose a reason for hiding this comment

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

Sure! So at last you didn't have to fix anything?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I think there must've been a bug in gcc that was patched.

@iluuu1994 iluuu1994 closed this in 1a0ef2c Jul 17, 2023
@iluuu1994 iluuu1994 merged commit 1a0ef2c into php:master Jul 17, 2023
16 checks passed
@dktapps
Copy link
Contributor

dktapps commented Jul 24, 2023

What was the motive for this reversion?

dktapps added a commit to pmmp/ext-pmmpthread that referenced this pull request Jul 24, 2023
This reverts commit 40a6626.

The change related to this commit was reverted by php/php-src#11604.
@iluuu1994
Copy link
Member Author

@dktapps Fixing the BC break of lowercasing the constant name through reflection. See ext/zend_test/tests/gh11423.phpt.

@dktapps
Copy link
Contributor

dktapps commented Jul 25, 2023

Thanks for explaining, that makes sense. #11423 is still open though.

@iluuu1994
Copy link
Member Author

@dktapps Ah, good catch, thanks!

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.

None yet

3 participants