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)))) {