mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #32427 (Interfaces are not allowed 'static' access modifier).
This commit is contained in:
parent
4f15b20b92
commit
694f7a9e90
2
NEWS
2
NEWS
@ -111,6 +111,8 @@ PHP NEWS
|
||||
(Uwe Schindler)
|
||||
- Fixed bug #32429 (method_exists() always return TRUE if __call method
|
||||
exists). (Dmitry)
|
||||
- Fixed bug #32427 (Interfaces are not allowed 'static' access modifier).
|
||||
(Dmitry)
|
||||
- Fixed bug #32109 ($_POST is not populated in multithreaded environment).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #31478 (segfault with empty() / isset()). (Moriyoshi)
|
||||
|
19
Zend/tests/bug32427.phpt
Normal file
19
Zend/tests/bug32427.phpt
Normal file
@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #32427 Interfaces are not allowed 'static' access modifier
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface Example {
|
||||
public static function sillyError();
|
||||
}
|
||||
|
||||
class ExampleImpl implements Example {
|
||||
public static function sillyError() {
|
||||
echo "I am a silly error\n";
|
||||
}
|
||||
}
|
||||
|
||||
ExampleImpl::sillyError();
|
||||
?>
|
||||
--EXPECT--
|
||||
I am a silly error
|
@ -1019,7 +1019,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
|
||||
if (is_method) {
|
||||
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
if (!(fn_flags_znode->u.constant.value.lval == ZEND_ACC_PUBLIC)) {
|
||||
if ((fn_flags_znode->u.constant.value.lval & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
|
||||
zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
|
||||
}
|
||||
fn_flags_znode->u.constant.value.lval |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
|
||||
|
Loading…
Reference in New Issue
Block a user