Bug #63994 [Opn->Dup]: assignment in function call argument does not workaround reference limitation
| From: | johannes@php.net | Date: | Wed, 16 Jan 2013 01:15:33 +0000 |
| Subject: | Bug #63994 [Opn->Dup]: assignment in function call argument does not workaround reference limitation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-176042@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63994&edit=1
ID: 63994
Updated by: johannes@php.net
Reported by: ahmetdevel at umich dot edu
Summary: assignment in function call argument does not
workaround reference limitation
-Status: Open
+Status: Duplicate
Type: Bug
Package: Compile Warning
Operating System: windows8
PHP Version: 5.4.10
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2013-01-15 21:58:13] bobwei9 at hotmail dot com
Duplicate of #63862.
------------------------------------------------------------------------
[2013-01-15 18:42:59] ahmetdevel at umich dot edu
Description:
------------
Introducing a dummy variable assignment in function arguments where a reference is
expected should be a reasonable workaround for the limitation that only variables
can be passed as reference. But, it causes a StrictStandards warning.
Separating it into two statements:
$dummy=0; foo($dummy);
of course works.
Test script:
---------------
<?
function foo(&$a){
}
foo($dummy=0);
Expected result:
----------------
No warning.
Actual result:
--------------
Strict Standards: Only variables should be passed by reference in .. on line 4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63994&edit=1