Skip to content

Refactored immplementation of https://wiki.php.net/rfc/class_const_vi… #1662

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

Closed
wants to merge 4 commits into from

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Dec 4, 2015

New PR based on @Sean-Der 's #1494

ZEND_ASSERT(c->flags & ZEND_ACC_PROTECTED);
return zend_check_protected(c->ce, scope);
}
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

Unreachable return.

@dstogov dstogov force-pushed the bug-69980-class-constants branch from 808442a to 05dbfc5 Compare December 7, 2015 08:34
@@ -310,6 +310,13 @@ typedef struct _zend_property_info {
#define OBJ_PROP_TO_NUM(offset) \
((offset - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))

typedef struct _zend_class_constant {
zval value;
uint32_t flags;
Copy link
Member

Choose a reason for hiding this comment

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

maybe you can use zval.u2.var_flags instead of flags here? which could save a pointer size for this struct

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea. I also though about this, but then forgot :)
I'll try to change this tomorrow.

On Mon, Dec 7, 2015 at 7:14 PM, Xinchen Hui [email protected]
wrote:

In Zend/zend_compile.h
#1662 (comment):

@@ -310,6 +310,13 @@ typedef struct _zend_property_info {
#define OBJ_PROP_TO_NUM(offset)
((offset - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))

+typedef struct _zend_class_constant {

  • zval value;
  • uint32_t flags;

maybe you can use zval.u2.var_flags instead of flags here? which should
save a pointer size for this struct


Reply to this email directly or view it on GitHub
https://github.com/php/php-src/pull/1662/files#r46839438.

@Sean-Der
Copy link
Contributor

Sean-Der commented Dec 7, 2015

Thank you so much @dstogov @nikic @laruence for all the work you have put into this. Sorry I haven't been more helpful, hard to know you made mistakes when you didn't spot them the first time :)

@dstogov dstogov force-pushed the bug-69980-class-constants branch from 05dbfc5 to f11ca0e Compare December 8, 2015 09:39
@dstogov
Copy link
Member Author

dstogov commented Dec 8, 2015

Merged into master.

@dstogov dstogov closed this Dec 8, 2015
@dstogov dstogov deleted the bug-69980-class-constants branch October 14, 2019 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants