diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-23 19:30:12 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-06-23 19:30:12 +0200 |
commit | cf70026ebc49114cbe3dc553f8fbf36aa86b7459 (patch) | |
tree | 871ae0dc4d1c4887775c9639e54f53e1b9f79513 /ext/reflection/php_reflection.c | |
parent | f1d0eadc4d7c582a8bff77c16d04849c8ec7e8cf (diff) | |
parent | f3cccfde9e895a8760a94b87c6516e66eda05761 (diff) | |
download | php-git-cf70026ebc49114cbe3dc553f8fbf36aa86b7459.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Revert "Fix #79487: ::getStaticProperties() ignores property modifications"
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b88712b7b5..0a116a0127 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3845,7 +3845,9 @@ static void add_class_vars(zend_class_entry *ce, zend_bool statics, zval *return zend_string *key; ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { - if (((prop_info->flags & ZEND_ACC_PRIVATE) && + if (((prop_info->flags & ZEND_ACC_PROTECTED) && + !zend_check_protected(prop_info->ce, ce)) || + ((prop_info->flags & ZEND_ACC_PRIVATE) && prop_info->ce != ce)) { continue; } @@ -3883,9 +3885,6 @@ ZEND_METHOD(ReflectionClass, getStaticProperties) { reflection_object *intern; zend_class_entry *ce; - zend_property_info *prop_info; - zval *prop; - zend_string *key; if (zend_parse_parameters_none() == FAILURE) { RETURN_THROWS(); @@ -3897,34 +3896,8 @@ ZEND_METHOD(ReflectionClass, getStaticProperties) return; } - if (!CE_STATIC_MEMBERS(ce)) { - zend_class_init_statics(ce); - } - array_init(return_value); - - ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) { - if (((prop_info->flags & ZEND_ACC_PRIVATE) && - prop_info->ce != ce)) { - continue; - } - if ((prop_info->flags & ZEND_ACC_STATIC) == 0) { - continue; - } - - prop = &CE_STATIC_MEMBERS(ce)[prop_info->offset]; - ZVAL_DEINDIRECT(prop); - - if (prop_info->type && Z_ISUNDEF_P(prop)) { - continue; - } - - /* enforce read only access */ - ZVAL_DEREF(prop); - Z_TRY_ADDREF_P(prop); - - zend_hash_update(Z_ARRVAL_P(return_value), key, prop); - } ZEND_HASH_FOREACH_END(); + add_class_vars(ce, 1, return_value); } /* }}} */ |