From: Andi Gutmans Date: Thu, 18 Mar 2004 08:52:51 +0000 (+0000) Subject: - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. X-Git-Tag: php-5.0.0RC1~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed6cbcb480cabb6172542e396f130abb91eb8d93;p=php - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 13f0b7bb7c..0a2745f5a7 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -997,13 +997,13 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n /* Improve after RC: cache the lowercase class name */ if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) { - if(CG(active_class_entry)->constructor) { - zend_error(E_COMPILE_ERROR, "Cannot redefine constructor for class %s", CG(active_class_entry)->name); + if (CG(active_class_entry)->constructor) { + zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name); } CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); } else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) { - if(CG(active_class_entry)->constructor) { - zend_error(E_COMPILE_ERROR, "Cannot redefine constructor for class %s", CG(active_class_entry)->name); + if (CG(active_class_entry)->constructor) { + zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name); } CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); } else if ((name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) {