From ed6cbcb480cabb6172542e396f130abb91eb8d93 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Thu, 18 Mar 2004 08:52:51 +0000 Subject: [PATCH] - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. --- Zend/zend_compile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 13f0b7bb7ca..0a2745f5a75 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)))) {