summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-09-26 07:55:21 +0000
committerDmitry Stogov <dmitry@php.net>2006-09-26 07:55:21 +0000
commita04b6ed6bcdda52c3f68199b547b3968bbbadd6c (patch)
treedc720f9ac5de5a9cb024b63a12dbef9f9915a13a /Zend/zend_builtin_functions.c
parentcc0d254e4f319279629c80530325d7c12dee1ec7 (diff)
downloadphp-git-a04b6ed6bcdda52c3f68199b547b3968bbbadd6c.tar.gz
Fixed bug #38942 (Double old-style-ctor inheritance)
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 06355a9689..6ae3a0fbd5 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -874,9 +874,21 @@ ZEND_FUNCTION(get_class_methods)
instanceof_function(EG(scope), mptr->common.scope TSRMLS_CC))
|| ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
EG(scope) == mptr->common.scope)))) {
- MAKE_STD_ZVAL(method_name);
- ZVAL_STRING(method_name, mptr->common.function_name, 1);
- zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
+ 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) {
+
+ MAKE_STD_ZVAL(method_name);
+ ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
+ zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
+ }
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}