From: Derick Rethans Date: Mon, 25 Mar 2002 20:37:02 +0000 (+0000) Subject: - MFZE1 X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1043 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7394b8fc6f1565cad5f1c5908d18d9a662f52a17;p=php - MFZE1 --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index e9cb8ccbac..18428eddd1 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -924,7 +924,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n op_array.scope = CG(active_class_entry); if (is_method) { - zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); + if (zend_hash_add(&CG(active_class_entry)->function_table, name, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)) == FAILURE) { + zend_error(E_ERROR, "Cannot redeclare method %s()", name); + } if ((CG(active_class_entry)->name_length == (uint) name_len) && (!memcmp(CG(active_class_entry)->name, name, name_len))) { CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); } else if ((function_name->u.constant.value.str.len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(function_name->u.constant.value.str.val, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {