- 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.
This commit is contained in:
Andi Gutmans 2004-10-13 01:04:08 +00:00
parent cce41cb736
commit 3e382a7d06

View 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 */
}