From: Dmitry Stogov Date: Wed, 17 Jan 2018 07:59:50 +0000 (+0300) Subject: A cheaper way to clone reference value. X-Git-Tag: php-7.3.0alpha1~602^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffa16693a7b2a90dbedf517330a1129b7c22bdf8;p=php A cheaper way to clone reference value. --- diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index a9d0273bc9..fe5b4dbd4a 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -880,9 +880,11 @@ PHP_FUNCTION(mysqli_stmt_execute) } for (j = i + 1; j < stmt->param.var_cnt; j++) { /* Oops, someone binding the same variable - clone */ - if (Z_TYPE(stmt->param.vars[j]) == Z_TYPE(stmt->param.vars[i]) && + if (Z_ISREF(stmt->param.vars[j]) && Z_REFVAL(stmt->param.vars[j]) == Z_REFVAL(stmt->param.vars[i])) { - SEPARATE_ZVAL(&stmt->param.vars[j]); + /*SEPARATE_ZVAL(&stmt->param.vars[j]);*/ + Z_DELREF_P(&stmt->param.vars[j]); + ZVAL_COPY(&stmt->param.vars[j], Z_REFVAL(stmt->param.vars[j])); break; } }