]> granicus.if.org Git - php/commitdiff
- Static functions cannot be abstract
authorMarcus Boerger <helly@php.net>
Sun, 19 Feb 2006 11:42:30 +0000 (11:42 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 19 Feb 2006 11:42:30 +0000 (11:42 +0000)
Zend/zend_API.c
Zend/zend_compile.c

index 5512419ff53867e22f4909c48a9442b1e35aaa8e..2225079fb298bf04c13e3e1a6ff5213b1ccd02c2 100644 (file)
@@ -2081,6 +2081,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
                                        scope->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
                                }
                        }
+                       if (ptr->flags & ZEND_ACC_STATIC) {
+                               zend_error(error_type, "Static function %s%s%s() cannot be abstract", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
+                       }
                } else {
                        if (scope && (scope->ce_flags & ZEND_ACC_INTERFACE)) {
                                efree(lc_class_name);
index ed514892c0a3e4a85ff45cc5f0f4e8534290ec1c..774455251f17e255f7536eb903da3d2fc16adecd 100644 (file)
@@ -1108,6 +1108,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
        } else {
                fn_flags = 0;
        }
+       if ((fn_flags & ZEND_ACC_STATIC) && (fn_flags & ZEND_ACC_ABSTRACT)) {
+               zend_error(E_COMPILE_ERROR, "Static function %v%s%R() cannot be abstract", is_method ? CG(active_class_entry)->name : "", is_method ? "::" : "", Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant));
+       }
 
        function_token->u.op_array = CG(active_op_array);
        lcname = zend_u_str_case_fold(Z_TYPE(function_name->u.constant), name, name_len, 0, &lcname_len);