cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c /ext/reflection/tests bug38942.phpt
| From: | Dmitry Stogov | Date: | Tue, 26 Sep 2006 07:55:21 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c /ext/reflection/tests bug38942.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-40708@lists.php.net to get a copy of this message | ||
dmitry Tue Sep 26 07:55:21 2006 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/reflection/tests bug38942.phpt
Modified files:
/php-src/ext/reflection php_reflection.c
Log:
Fixed bug #38942 (Double old-style-ctor inheritance)
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.24&r2=1.164.2.33.2.25&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.24
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.25
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.24 Mon Sep 11 21:21:43 2006
+++ php-src/ext/reflection/php_reflection.c Tue Sep 26 07:55:20 2006
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_reflection.c,v 1.164.2.33.2.24 2006/09/11 21:21:43 johannes Exp $ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.25 2006/09/26 07:55:20 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -518,8 +518,20 @@
while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos)
== SUCCESS) {
if (!(mptr->common.fn_flags & ZEND_ACC_STATIC)) {
- string_printf(str, "\n");
- _function_string(str, mptr, ce, sub_indent.string TSRMLS_CC);
+ char *key;
+ uint key_len;
+ ulong num_index;
+ uint len = strlen(mptr->common.function_name);
+
+ /* Do not display old-style inherited constructors */
+ if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
+ mptr->common.scope == ce ||
+ zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len,
&num_index, 0, &pos) != HASH_KEY_IS_STRING ||
+ zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
+
+ string_printf(str, "\n");
+ _function_string(str, mptr, ce, sub_indent.string TSRMLS_CC);
+ }
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}
@@ -4815,7 +4827,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.24
2006/09/11 21:21:43 johannes Exp $");
+ php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33.2.25
2006/09/26 07:55:20 dmitry Exp $");
php_info_print_table_end();
} /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug38942.phpt?view=markup&rev=1.1
Index: php-src/ext/reflection/tests/bug38942.phpt
+++ php-src/ext/reflection/tests/bug38942.phpt