]> granicus.if.org Git - php/commitdiff
- Don't allow access modifiers in interfaces. Explicitly stating public
authorAndi Gutmans <andi@php.net>
Wed, 13 Oct 2004 01:04:08 +0000 (01:04 +0000)
committerAndi Gutmans <andi@php.net>
Wed, 13 Oct 2004 01:04:08 +0000 (01:04 +0000)
- should also be disallowed but we don't have a way to detect it today.

Zend/zend_compile.c

index f5e3fe8dc5d45b27ab2162d115a89ab862607296..e4d86b9706fd4e7cd47ed3df7b322edc19c952b4 100644 (file)
@@ -1013,8 +1013,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
 
        if (is_method) {
                if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
-                       if (!(fn_flags_znode->u.constant.value.lval & ZEND_ACC_PUBLIC)) {
-                               zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted or declared public", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
+                       if (!(fn_flags_znode->u.constant.value.lval == ZEND_ACC_PUBLIC)) {
+                               zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
                        }
                        fn_flags_znode->u.constant.value.lval |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
                }