]> granicus.if.org Git - php/commitdiff
Allow final private methods
authorMarcus Boerger <helly@php.net>
Thu, 3 Jul 2003 16:45:37 +0000 (16:45 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 3 Jul 2003 16:45:37 +0000 (16:45 +0000)
#
# 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 ?

Zend/zend_compile.c

index 7b6eda00cfb91138057760f5dc7a4956eb9fb04a..51a0bd22395f4fefcf9eb212c6bfc7874e64c5f3 100644 (file)
@@ -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);
 }