Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55706 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76159 invoked from network); 6 Oct 2011 15:31:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Oct 2011 15:31:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=dk@uw.no; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dk@uw.no; sender-id=unknown Received-SPF: error (pb1.pair.com: domain uw.no from 193.71.32.2 cause and error) X-PHP-List-Original-Sender: dk@uw.no X-Host-Fingerprint: 193.71.32.2 mx-1.vendo.no Linux 2.4/2.6 Received: from [193.71.32.2] ([193.71.32.2:54894] helo=mx-1.vendo.no) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/34-41898-8B9CD8E4 for ; Thu, 06 Oct 2011 11:31:05 -0400 Received: (qmail 25842 invoked from network); 6 Oct 2011 15:31:00 -0000 Received: from daniel.tbg.sysedata.no (HELO ?10.0.1.127?) (195.159.98.89) by mx-1.vendo.no with SMTP; 6 Oct 2011 15:31:00 -0000 Message-ID: <4E8DC9B4.7040809@uw.no> Date: Thu, 06 Oct 2011 17:31:00 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13 MIME-Version: 1.0 To: internals@lists.php.net CC: Etienne Kneuss References: <4E7C764C.3000808@uw.no> In-Reply-To: <4E7C764C.3000808@uw.no> Content-Type: multipart/mixed; boundary="------------040800030306040408040100" Subject: Re: [PHP-DEV] [PATCH] Fix for bug #55754 From: dk@uw.no ("Daniel K.") --------------040800030306040408040100 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 09/23/2011 02:06 PM, I wrote: > When a built-in function is defined with ZEND_SEND_PREFER_REF, PHP will > issue a strict warning if you use an assignment expression as the parameter. > > As an example, current() show this behaviour. > > current($foo = array("bar")); > ?> > > Presents you with: > > PHP Strict Standards: Only variables should be passed by reference in > %s on line %d A patch was appended, discussed, and improved, and I have uploaded a test-case, as well as a minimal patch that fixes the problem (attached) to the original bug-report. https://bugs.php.net/bug.php?id=55754 The patch still applies to trunk, and I think it should be applied to the 5.3 and 5.4 branches as well. What to do next? The feedback has been constructive, but I feel it has stagnated a bit. Of course, you may all be busy with other interesting stuff, but is there anything else you require from me to get this rolling? Should I explain better why I think it's an issue, and why the patch is needed? An indication as to if anyone is reviewing the proposed patch, and considering applying it, or telling me that this is the completely wrong approach to solve the problem and dropping a few hints would be most appreciated, but any feedback is welcome. Daniel K. --------------040800030306040408040100 Content-Type: text/x-patch; name="bug55754_minimal.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug55754_minimal.patch" diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c325a7e..d361c64 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2096,7 +2096,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{ if (function_ptr) { if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { - if (param->op_type & (IS_VAR|IS_CV)) { + if (param->op_type & (IS_VAR|IS_CV) && original_op != ZEND_SEND_VAL) { send_by_reference = 1; if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) { /* Method call */ --------------040800030306040408040100--