From: Dmitry Stogov Date: Mon, 30 Jun 2014 11:40:28 +0000 (+0400) Subject: Prohibited parameter redefinition X-Git-Tag: POST_PHPNG_MERGE~90^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45082daa3a721896f1e306aa6eafb00a57bd1cc7;p=php Prohibited parameter redefinition --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a49195d407..647fab48be 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1844,7 +1844,9 @@ void zend_do_receive_param(zend_uchar op, znode *varname, znode *initialization, var.u.op.var = lookup_cv(CG(active_op_array), Z_STR(varname->u.constant) TSRMLS_CC); Z_STR(varname->u.constant) = CG(active_op_array)->vars[EX_VAR_TO_NUM(var.u.op.var)]; var.EA = 0; - if (Z_STRHASH(varname->u.constant) == THIS_HASHVAL && + if (EX_VAR_TO_NUM(var.u.op.var) != CG(active_op_array)->num_args) { + zend_error_noreturn(E_COMPILE_ERROR, "Redefinition of parameter %s", Z_STRVAL(varname->u.constant)); + } else if (Z_STRHASH(varname->u.constant) == THIS_HASHVAL && Z_STRLEN(varname->u.constant) == sizeof("this")-1 && !memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")-1)) { if (CG(active_op_array)->scope &&