From: Dmitry Stogov Date: Tue, 1 Nov 2016 19:56:25 +0000 (+0300) Subject: Intriduced ZEND_ACC_INHERITED class flag. X-Git-Tag: php-7.1.0RC6~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdc1ba3e3a314da472ef132e233f8b37ddac39e1;p=php Intriduced ZEND_ACC_INHERITED class flag. It's going to be helpful for static optimisations, when "parent" is not known yet. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f53365fd58..47cc6c649c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5949,6 +5949,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */ } zend_compile_class_ref(&extends_node, extends_ast, 0); + ce->ce_flags |= ZEND_ACC_INHERITED; } opline = get_next_op(CG(active_op_array)); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 1f0773d9a7..422404d0a3 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -213,6 +213,7 @@ typedef struct _zend_oparray_context { #define ZEND_ACC_TRAIT 0x80 #define ZEND_ACC_ANON_CLASS 0x100 #define ZEND_ACC_ANON_BOUND 0x200 +#define ZEND_ACC_INHERITED 0x400 /* method flags (visibility) */ /* The order of those must be kept - public < protected < private */ diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9ecb04d461..1169bb682c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4783,7 +4783,7 @@ ZEND_METHOD(reflection_class, getModifiers) } GET_REFLECTION_OBJECT_PTR(ce); - RETURN_LONG(ce->ce_flags & ~(ZEND_ACC_CONSTANTS_UPDATED|ZEND_ACC_USE_GUARDS)); + RETURN_LONG(ce->ce_flags & ~(ZEND_ACC_CONSTANTS_UPDATED|ZEND_ACC_USE_GUARDS|ZEND_ACC_INHERITED)); } /* }}} */