felipe Sun Jul 20 16:51:28 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/reflection/tests bug45571.phpt
Modified files: /php-src/ext/reflection php_reflection.c Log: - Fixed bug #45571 (ReflectionClass::export() shows superclasses' private static methods.) patch by Robin Fernandes http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.19&r2=1.164.2.33.2.45.2.20&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.19 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.20 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.19 Mon Jul 14 09:49:03 2008 +++ php-src/ext/reflection/php_reflection.c Sun Jul 20 16:51:28 2008 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.19 2008/07/14 09:49:03 dmitry Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.20 2008/07/20 16:51:28 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -417,7 +417,7 @@ /* 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 @@ 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 @@ 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); } @@ -5114,7 +5116,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33.2.45.2.19 2008/07/14 09:49:03 dmitry Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33.2.45.2.20 2008/07/20 16:51:28 felipe Exp $"); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug45571.phpt?view=markup&rev=1.1 Index: php-src/ext/reflection/tests/bug45571.phpt +++ php-src/ext/reflection/tests/bug45571.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php