summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-09-02 13:26:25 +0000
committerMarcus Boerger <helly@php.net>2003-09-02 13:26:25 +0000
commit0f3374615bd5c7b29212ea5889d7286ead2dc38d (patch)
treeb876f0d1ac3f8d59ad51b97511a36a096a22efe4 /Zend/zend_compile.c
parent0f1b506f20bd48774d63a0aa93cc53c5b24b7705 (diff)
downloadphp-git-0f3374615bd5c7b29212ea5889d7286ead2dc38d.tar.gz
Currently we cannot support static ctor/dtor
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 3f1f0917d7..0e16ed9fb6 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2277,9 +2277,15 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
if (ce->constructor) {
ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
+ if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(E_COMPILE_ERROR, "Constructor %s::%s cannot be static", ce->name, ce->constructor->common.function_name);
+ }
}
if (ce->destructor) {
ce->destructor->common.fn_flags |= ZEND_ACC_DTOR;
+ if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(E_COMPILE_ERROR, "Destructor %s::%s cannot be static", ce->name, ce->destructor->common.function_name);
+ }
}
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);