mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
- 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:
parent
cce41cb736
commit
3e382a7d06
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user