From: Andi Gutmans Date: Wed, 13 Oct 2004 01:04:08 +0000 (+0000) Subject: - Don't allow access modifiers in interfaces. Explicitly stating public X-Git-Tag: PRE_NEW_VM_GEN_PATCH~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e382a7d061bb3b7c0f70b23848dd397d12913b4;p=php - Don't allow access modifiers in interfaces. Explicitly stating public - should also be disallowed but we don't have a way to detect it today. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f5e3fe8dc5..e4d86b9706 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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 */ }