mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Fixed bug #71871
This commit is contained in:
parent
e988239634
commit
dc842bbf8d
1
NEWS
1
NEWS
@ -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
12
Zend/tests/bug71871.phpt
Normal 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
|
12
Zend/tests/bug71871_2.phpt
Normal file
12
Zend/tests/bug71871_2.phpt
Normal 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
|
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user