diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-11-04 11:24:32 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-11-04 11:24:32 +0100 |
commit | 5b447d4b42416eb5c5ef94cf0b374e5a60ec4f39 (patch) | |
tree | 5495f82e1efee5cb27e15c4b4a4eddc9e5cfa019 /ext/reflection/php_reflection.c | |
parent | 0e3045ae69d1b80c21b2779df721a4ad8bcda401 (diff) | |
download | php-git-5b447d4b42416eb5c5ef94cf0b374e5a60ec4f39.tar.gz |
Remove dead code related to inherits props in reflection
Public/protected properties defined in parent classes will be
inherited in the child -- there is no need to explicitly try to
walk up the chain and look them up.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8e8771482c..5bfbb5f6f9 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1196,23 +1196,6 @@ static void reflection_property_factory(zend_class_entry *ce, zend_string *name, reflection_object *intern; property_reference *reference; - if (!prop || !(prop->flags & ZEND_ACC_PRIVATE)) { - /* we have to search the class hierarchy for this (implicit) public or protected property */ - zend_class_entry *tmp_ce = ce, *store_ce = ce; - zend_property_info *tmp_info = NULL; - - while (tmp_ce && (tmp_info = zend_hash_find_ptr(&tmp_ce->properties_info, name)) == NULL) { - ce = tmp_ce; - tmp_ce = tmp_ce->parent; - } - - if (tmp_info && (!(tmp_info->flags & ZEND_ACC_PRIVATE) || tmp_info->ce == tmp_ce)) { /* found something and it's not a parent's private */ - prop = tmp_info; - } else { /* not found, use initial value */ - ce = store_ce; - } - } - reflection_instantiate(reflection_property_ptr, object); intern = Z_REFLECTION_P(object); reference = (property_reference*) emalloc(sizeof(property_reference)); @@ -5247,18 +5230,6 @@ ZEND_METHOD(reflection_property, __construct) } } - if (dynam_prop == 0 && (property_info->flags & ZEND_ACC_PRIVATE) == 0) { - /* we have to search the class hierarchy for this (implicit) public or protected property */ - zend_class_entry *tmp_ce = ce; - zend_property_info *tmp_info; - - while (tmp_ce && (tmp_info = zend_hash_find_ptr(&tmp_ce->properties_info, name)) == NULL) { - ce = tmp_ce; - property_info = tmp_info; - tmp_ce = tmp_ce->parent; - } - } - ZVAL_STR_COPY(reflection_prop_name(object), name); if (dynam_prop == 0) { ZVAL_STR_COPY(reflection_prop_class(object), property_info->ce->name); |