diff options
author | Marcus Boerger <helly@php.net> | 2004-06-15 20:39:49 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-06-15 20:39:49 +0000 |
commit | 4fec06587b10b2658a8752e44a28cb5ecd342f81 (patch) | |
tree | 720aa7c2c0041f8d02ee68278764aa90858971a6 /ext/reflection/php_reflection.c | |
parent | 0f5e09c19238603a759e086cc20ddc334957a588 (diff) | |
download | php-git-4fec06587b10b2658a8752e44a28cb5ecd342f81.tar.gz |
#28789: ReflectionProperty getValue() fails on public static members
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 7817f41330..f198cbd593 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2873,7 +2873,7 @@ ZEND_METHOD(reflection_property, getValue) METHOD_NOTSTATIC; GET_REFLECTION_OBJECT_PTR(ref); - if (ref->prop->flags & ~ZEND_ACC_PUBLIC) { + if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) { _DO_THROW("Cannot access non-public member"); /* Returns from this function */ } @@ -2882,9 +2882,16 @@ ZEND_METHOD(reflection_property, getValue) return; } - if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { - zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name); - /* Bails out */ + if ((ref->prop->flags & ZEND_ACC_STATIC)) { + if (zend_hash_quick_find(Z_OBJCE_P(object)->static_members, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { + zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name); + /* Bails out */ + } + } else { + if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { + zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name); + /* Bails out */ + } } *return_value= **member; |