From: Marcus Boerger Date: Thu, 3 Jul 2003 16:45:37 +0000 (+0000) Subject: Allow final private methods X-Git-Tag: BEFORE_ARG_INFO~388 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7e14ad8a3f0c2f4b5f4820ec3caca7be59a9b71;p=php Allow final private methods # # 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 ? --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 7b6eda00cf..51a0bd2239 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -966,9 +966,6 @@ int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier) 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); }