Req #69155 [Opn->Nab]: reference seems incorrect when parameter is passed by expression

From: Date: Mon, 02 Mar 2015 16:03:01 +0000
Subject: Req #69155 [Opn->Nab]: reference seems incorrect when parameter is passed by expression
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191049@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69155&edit=1 ID: 69155 Updated by: reeze@php.net Reported by: leejqy at 163 dot com Summary: reference seems incorrect when parameter is passed by expression -Status: Open +Status: Not a bug Type: Feature/Change Request Package: Scripting Engine problem Operating System: linux/windows PHP Version: 5.4.38 Block user comment: N Private report: N New Comment: @see http://3v4l.org/CaKKR There is a strict warning complain about it. Previous Comments: ------------------------------------------------------------------------ [2015-03-02 09:47:38] leejqy at 163 dot com Description: ------------ When a parameter(declared as reference) is passed by mixing an expression & assignment, the paramter actually passed seems to be the expression, not the variable itself. PHP version tested: 5.4.37 & 5.5.18. Test script: --------------- function test (&$a) { $a = 10; } test ($a = 20); echo $a; Expected result: ---------------- 10 Actual result: -------------- 20 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69155&edit=1

« previous php.bugs (#191049) next »