]> granicus.if.org Git - php/commitdiff
- If __construct() is defined then it will always take precedence over
authorAndi Gutmans <andi@php.net>
Thu, 25 Mar 2004 18:00:50 +0000 (18:00 +0000)
committerAndi Gutmans <andi@php.net>
Thu, 25 Mar 2004 18:00:50 +0000 (18:00 +0000)
- old style constructors.

Zend/zend_compile.c

index 6c4c48294a77fc01a4ba35555768f520c0e90e3b..a5348d5082a21fbcbf216c05e557fcaed6eefd67 100644 (file)
@@ -999,8 +999,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
                if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
                        if (CG(active_class_entry)->constructor) {
                                zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
+                       } else {
+                               CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
                        }
-                       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_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);