#
# Declaring a method private and final would only be an error for an abstract
# class. But at the moment the method is defined and it's modifiers are checked
# we do not know whether or not we have an abstract class. It could already be
# abstract but it also become abstract later.
#
# Since i made the mistake in first place i remove the check now.
#
# Providing the correct test would slow down the compiler becuase we'd have to
# iterate through all methods on all abstract classes and check for this. I
# guess we can live without. Or does anybody wants this to be implemented ?
if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member");
}
- if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_PRIVATE | ZEND_ACC_FINAL)) == (ZEND_ACC_PRIVATE | ZEND_ACC_FINAL)) {
- zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on a private class member");
- }
return (current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval);
}