]> granicus.if.org Git - php/commitdiff
- Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT.
authorAndi Gutmans <andi@php.net>
Thu, 18 Mar 2004 08:52:51 +0000 (08:52 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 18 Mar 2004 08:52:51 +0000 (08:52 +0000)
Zend/zend_compile.c

index 13f0b7bb7ca0a952aec4a101d7d93ea38c3f5a29..0a2745f5a75758f0ad663629c4cfd268f0516071 100644 (file)
@@ -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)))) {