php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63994 assignment in function call argument does not workaround reference limitation
Submitted: 2013-01-15 18:42 UTC Modified: 2013-01-16 01:15 UTC
From: ahmetdevel at umich dot edu Assigned:
Status: Duplicate Package: Compile Warning
PHP Version: 5.4.10 OS: windows8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ahmetdevel at umich dot edu
New email:
PHP Version: OS:

 

 [2013-01-15 18:42 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-15 21:58 UTC] bobwei9 at hotmail dot com
Duplicate of #63862.
 [2013-01-16 01:15 UTC] johannes@php.net
-Status: Open +Status: Duplicate
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC