diff options
author | Dmitry Stogov <dmitry@php.net> | 2006-09-26 07:55:21 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2006-09-26 07:55:21 +0000 |
commit | a04b6ed6bcdda52c3f68199b547b3968bbbadd6c (patch) | |
tree | dc720f9ac5de5a9cb024b63a12dbef9f9915a13a /ext/reflection/php_reflection.c | |
parent | cc0d254e4f319279629c80530325d7c12dee1ec7 (diff) | |
download | php-git-a04b6ed6bcdda52c3f68199b547b3968bbbadd6c.tar.gz |
Fixed bug #38942 (Double old-style-ctor inheritance)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index bca4032f99..65ad634949 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -518,8 +518,20 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in 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); } |