]> granicus.if.org Git - php/commitdiff
- MFB: Fixed bug #45571 (ReflectionClass::export() shows superclasses' private static...
authorFelipe Pena <felipe@php.net>
Sun, 20 Jul 2008 17:02:05 +0000 (17:02 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 20 Jul 2008 17:02:05 +0000 (17:02 +0000)
ext/reflection/php_reflection.c

index 0549ad4dd18b9fd9af3dc5ed2c9969053b719fc9..3473b212480c5228ecde24dd4c7fdbef3a3a4524 100644 (file)
@@ -416,7 +416,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;
@@ -425,14 +425,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;
@@ -441,7 +442,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);
                                }