felipe Sun Jul 20 17:02:06 2008 UTC
Modified files:
/php-src/ext/reflection php_reflection.c
Log:
- MFB: Fixed bug #45571 (ReflectionClass::export() shows superclasses'
private static methods.)
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.299&r2=1.300&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.299
php-src/ext/reflection/php_reflection.c:1.300
--- php-src/ext/reflection/php_reflection.c:1.299 Tue Jul 8 07:05:04 2008
+++ php-src/ext/reflection/php_reflection.c Sun Jul 20 17:02:05 2008
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_reflection.c,v 1.299 2008/07/08 07:05:04 dmitry Exp $ */
+/* $Id: php_reflection.c,v 1.300 2008/07/20 17:02:05 felipe Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -416,7 +416,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;
@@ -425,14 +425,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;
@@ -441,7 +442,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);
}
@@ -5255,7 +5257,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.299
2008/07/08 07:05:04 dmitry Exp $");
+ php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.300
2008/07/20 17:02:05 felipe Exp $");
php_info_print_table_end();
} /* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php