summaryrefslogtreecommitdiff
path: root/Zend/zend_object_handlers.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-10-10 23:18:34 +0200
committerNikita Popov <nikita.ppv@gmail.com>2018-10-10 23:18:34 +0200
commit4d5d77904e9e4dc52236ec5416d1ddfef9b3911c (patch)
treea1dfec098bbacf31a52a0d6e966b9b9ada6e428a /Zend/zend_object_handlers.c
parent76c8d79df6e6de23eb97e81adde2d3c2b97fd7a8 (diff)
downloadphp-git-4d5d77904e9e4dc52236ec5416d1ddfef9b3911c.tar.gz
Fix foreach/get_object_vars for shadowed properties
If we are in a scope where the shadowed private property is visible, the shadowing public property should not be visible.
Diffstat (limited to 'Zend/zend_object_handlers.c')
-rw-r--r--Zend/zend_object_handlers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 6773f99704..ccc4ebe777 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -558,6 +558,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
} else {
ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
}
+ return SUCCESS;
} else {
property_info = zend_get_property_info(zobj->ce, prop_info_name, 1);
if (property_info == NULL) {
@@ -565,9 +566,8 @@ ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_inf
} else if (property_info == ZEND_WRONG_PROPERTY_INFO) {
return FAILURE;
}
- ZEND_ASSERT(property_info->flags & ZEND_ACC_PUBLIC);
+ return (property_info->flags & ZEND_ACC_PUBLIC) ? SUCCESS : FAILURE;
}
- return SUCCESS;
}
/* }}} */