Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.783 diff -u -p -r1.783 zend_compile.c --- Zend/zend_compile.c 12 Nov 2007 17:53:36 -0000 1.783 +++ Zend/zend_compile.c 13 Nov 2007 16:46:46 -0000 @@ -1126,10 +1126,21 @@ void zend_do_free(znode *op1 TSRMLS_DC) int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier) /* {{{ */ { if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) - && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK) - && ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) != (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK))) { + && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)) { zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed"); } + if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_ABSTRACT) + && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_ABSTRACT)) { + zend_error(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed"); + } + if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_STATIC) + && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_STATIC)) { + zend_error(E_COMPILE_ERROR, "Multiple static modifiers are not allowed"); + } + if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_FINAL) + && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_FINAL)) { + zend_error(E_COMPILE_ERROR, "Multiple final modifiers are not allowed"); + } if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (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"); } Index: Zend/tests/mult_modifiers_abstract.phpt =================================================================== RCS file: Zend/tests/mult_modifiers_abstract.phpt diff -N Zend/tests/mult_modifiers_abstract.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Zend/tests/mult_modifiers_abstract.phpt 13 Nov 2007 16:46:46 -0000 @@ -0,0 +1,11 @@ +--TEST-- +Multiple abstract modifiers are not allowed +--FILE-- + +==DONE== +--EXPECTF-- +Fatal error: Multiple abstract modifiers are not allowed in %s on line %d Index: Zend/tests/mult_modifiers_final.phpt =================================================================== RCS file: Zend/tests/mult_modifiers_final.phpt diff -N Zend/tests/mult_modifiers_final.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Zend/tests/mult_modifiers_final.phpt 13 Nov 2007 16:46:46 -0000 @@ -0,0 +1,12 @@ +--TEST-- +Multiple final modifiers are not allowed +--FILE-- + +==DONE== +--EXPECTF-- +Fatal error: Multiple final modifiers are not allowed in %s on line %d Index: Zend/tests/mult_modifiers_ppp.phpt =================================================================== RCS file: Zend/tests/mult_modifiers_ppp.phpt diff -N Zend/tests/mult_modifiers_ppp.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Zend/tests/mult_modifiers_ppp.phpt 13 Nov 2007 16:46:46 -0000 @@ -0,0 +1,12 @@ +--TEST-- +Multiple access type modifiers are not allowed +--FILE-- + +==DONE== +--EXPECTF-- +Fatal error: Multiple access type modifiers are not allowed in %s on line %d Index: Zend/tests/mult_modifiers_static.phpt =================================================================== RCS file: Zend/tests/mult_modifiers_static.phpt diff -N Zend/tests/mult_modifiers_static.phpt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Zend/tests/mult_modifiers_static.phpt 13 Nov 2007 16:46:46 -0000 @@ -0,0 +1,12 @@ +--TEST-- +Multiple static modifiers are not allowed +--FILE-- + +==DONE== +--EXPECTF-- +Fatal error: Multiple static modifiers are not allowed in %s on line %d