summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-01-23 20:52:39 +0000
committerMarcus Boerger <helly@php.net>2004-01-23 20:52:39 +0000
commit7c2e02d38019efcd170ec789bd360de5637d1b84 (patch)
treee8c76cb6d7b0edac6197bdd71f084e61a40b2207 /Zend/zend_compile.c
parent3eb16bc3a98c59f145c6b4b012d2fb4f5bfa012e (diff)
downloadphp-git-7c2e02d38019efcd170ec789bd360de5637d1b84.tar.gz
Disallow static declaration of clone
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 364df789c0..1c9d8d2570 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2400,6 +2400,12 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
zend_error(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name);
}
}
+ if (ce->clone) {
+ ce->clone->common.fn_flags |= ZEND_ACC_CLONE;
+ if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name);
+ }
+ }
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);