diff options
author | Marcus Boerger <helly@php.net> | 2004-03-26 20:05:35 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-03-26 20:05:35 +0000 |
commit | aea24b2a79597ffd9c6e89bc199113a548a383be (patch) | |
tree | dc9ca49686e6297aeb637e60bd9c1af8c125da48 | |
parent | 92d8c3d06e412ffeeb68e21f2d859067f1fc5cb1 (diff) | |
download | php-git-aea24b2a79597ffd9c6e89bc199113a548a383be.tar.gz |
Force destructors to have empty signatures
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | Zend/zend_API.c | 4 | ||||
-rw-r--r-- | Zend/zend_compile.c | 4 |
3 files changed, 9 insertions, 0 deletions
@@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ????? 2004, PHP 5 Release Candidate 2 +- Force destructors to have empty signatures. (Marcus) - Stopped file uploads from throwing E_WARNINGs and E_NOTICEs which can not be hidden from within scripts (and a result value in the $_FILES global can be used to see the real failure anyway). (Derick) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 096a99bcf2..ccc25cf3a3 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1275,6 +1275,10 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr ctor = reg_function; } else if (!strcmp(ptr->fname, ZEND_DESTRUCTOR_FUNC_NAME)) { dtor = reg_function; + if (internal_function->num_args) { + zend_error(error_type, "Destructor %s::%s() cannot take arguments", scope->name, ptr->fname); + } + } else if (!strcmp(ptr->fname, ZEND_CLONE_FUNC_NAME)) { clone = reg_function; } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a5348d5082..2f3cfcd24c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1114,6 +1114,10 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); zend_arg_info *cur_arg_info; + if (CG(active_class_entry) && CG(active_class_entry)->destructor == (zend_function *) CG(active_op_array)) + { + zend_error(E_COMPILE_ERROR, "Destuctor %s::%s() cannot take arguments", CG(active_class_entry)->name, CG(active_op_array)->function_name); + } CG(active_op_array)->num_args++; opline->opcode = op; opline->result = *var; |