From 694f7a9e908e7f6df78972aeb937bced2013586d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 26 Apr 2005 08:48:23 +0000 Subject: [PATCH] Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). --- NEWS | 2 ++ Zend/tests/bug32427.phpt | 19 +++++++++++++++++++ Zend/zend_compile.c | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug32427.phpt diff --git a/NEWS b/NEWS index 4cec0987a9..2f2308c694 100644 --- a/NEWS +++ b/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) diff --git a/Zend/tests/bug32427.phpt b/Zend/tests/bug32427.phpt new file mode 100644 index 0000000000..0a5cc4f893 --- /dev/null +++ b/Zend/tests/bug32427.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #32427 Interfaces are not allowed 'static' access modifier +--FILE-- + +--EXPECT-- +I am a silly error diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 41c0104979..d3ee2c3f02 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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 */ -- 2.50.1