This commit is contained in:
Nikita Popov 2016-03-21 22:49:18 +01:00
parent e988239634
commit dc842bbf8d
4 changed files with 26 additions and 1 deletions

1
NEWS
View File

@ -14,6 +14,7 @@ PHP NEWS
. Fixed bug #69659 (ArrayAccess, isset() and the offsetExists method).
(Nikita)
. Fixed bug #62059 (ArrayObject and isset are not friends). (Nikita)
. Fixed bug #71871 (Interfaces allow final and abstract functions). (Nikita)
- Curl:
. Fixed bug #71831 (CURLOPT_NOPROXY applied as long instead of string).

12
Zend/tests/bug71871.phpt Normal file
View File

@ -0,0 +1,12 @@
--TEST--
Bug #71871: Interfaces allow final and abstract functions
--FILE--
<?php
interface test {
final function test();
}
?>
--EXPECTF--
Fatal error: Access type for interface method test::test() must be omitted in %s on line %d

View File

@ -0,0 +1,12 @@
--TEST--
Bug #71871: Interfaces allow final and abstract functions
--FILE--
<?php
interface test {
abstract function test();
}
?>
--EXPECTF--
Fatal error: Access type for interface method test::test() must be omitted in %s on line %d

View File

@ -4649,7 +4649,7 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
zend_string *lcname;
if (in_interface) {
if ((op_array->fn_flags & ZEND_ACC_PPP_MASK) != ZEND_ACC_PUBLIC) {
if (!is_public || (op_array->fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_ABSTRACT))) {
zend_error_noreturn(E_COMPILE_ERROR, "Access type for interface method "
"%s::%s() must be omitted", ZSTR_VAL(ce->name), ZSTR_VAL(name));
}