summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c16
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);
}