-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Revert "Remove name field from the zend_constant struct (#10954)" #11604
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
Conversation
82e2591
to
246d294
Compare
This reverts commit f42992f. Closes phpGH-11604
246d294
to
1a0ef2c
Compare
@@ -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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
What was the motive for this reversion? |
This reverts commit 40a6626. The change related to this commit was reverted by php/php-src#11604.
@dktapps Fixing the BC break of lowercasing the constant name through reflection. See ext/zend_test/tests/gh11423.phpt. |
Thanks for explaining, that makes sense. #11423 is still open though. |
@dktapps Ah, good catch, thanks! |
This reverts commit f42992f.