Fixed bug #32427 (Interfaces are not allowed 'static' access modifier).

This commit is contained in:
Dmitry Stogov 2005-04-26 08:48:23 +00:00
parent 4f15b20b92
commit 694f7a9e90
3 changed files with 22 additions and 1 deletions

2
NEWS
View File

@ -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
View 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

View File

@ -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 */