summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-07-20 16:51:28 +0000
committerFelipe Pena <felipe@php.net>2008-07-20 16:51:28 +0000
commita83e97685783eb501d4e7e8f5e0b21f9f9306dd9 (patch)
tree55f04f82aa94c564e5ff0d4af88350affb1f22b2 /ext/reflection/php_reflection.c
parent3d0d02f95b90324e398c1662052b9c7ecbc4a8c8 (diff)
downloadphp-git-a83e97685783eb501d4e7e8f5e0b21f9f9306dd9.tar.gz
- Fixed bug #45571 (ReflectionClass::export() shows superclasses' private static methods.)
patch by Robin Fernandes
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index f99e009830..601850fdb7 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -417,7 +417,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* Static methods */
if (&ce->function_table) {
- /* counting static properties */
+ /* counting static methods */
count = zend_hash_num_elements(&ce->function_table);
if (count > 0) {
HashPosition pos;
@@ -426,14 +426,15 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos);
while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) {
- if (mptr->common.fn_flags & ZEND_ACC_STATIC) {
+ if (mptr->common.fn_flags & ZEND_ACC_STATIC
+ && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) {
count_static_funcs++;
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}
}
- /* static properties */
+ /* static methods */
string_printf(str, "\n%s - Static methods [%d] {", indent, count_static_funcs);
if (count_static_funcs > 0) {
HashPosition pos;
@@ -442,7 +443,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos);
while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) {
- if (mptr->common.fn_flags & ZEND_ACC_STATIC) {
+ if (mptr->common.fn_flags & ZEND_ACC_STATIC
+ && ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) {
string_printf(str, "\n");
_function_string(str, mptr, ce, sub_indent.string TSRMLS_CC);
}