From c75f162165bc3bc144dbe7ddfd4638f0e910e3de Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sat, 1 Aug 2009 20:44:00 +0000 Subject: - Fixed ReflectionClass::getStaticProperties() to do not return the private properties from parent class; behavior already adopted in ReflectionClass::getDefaultProperties() and ReflectionClass::getProperties(). --- ext/reflection/php_reflection.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8999c19994..7dfc0c86ea 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3060,13 +3060,16 @@ ZEND_METHOD(reflection_class, getStaticProperties) zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name); - /* copy: enforce read only access */ - ALLOC_ZVAL(prop_copy); - *prop_copy = **value; - zval_copy_ctor(prop_copy); - INIT_PZVAL(prop_copy); + /* filter privates from base classes */ + if (!(class_name && class_name[0] != '*' && strcmp(class_name, ce->name))) { + /* copy: enforce read only access */ + ALLOC_ZVAL(prop_copy); + *prop_copy = **value; + zval_copy_ctor(prop_copy); + INIT_PZVAL(prop_copy); - add_assoc_zval(return_value, prop_name, prop_copy); + add_assoc_zval(return_value, prop_name, prop_copy); + } } zend_hash_move_forward_ex(CE_STATIC_MEMBERS(ce), &pos); } -- cgit v1.2.1