php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35715 Incompatibility in reference handling
Submitted: 2005-12-16 21:41 UTC Modified: 2005-12-16 21:48 UTC
From: messju at lammfellpuschen dot de Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2005-12-16 (CVS) OS:
Private report: No CVE-ID: None
 [2005-12-16 21:41 UTC] messju at lammfellpuschen dot de
Description:
------------
When an assingment is passed as a function argument that is expected to be passed by reference, an E_STRICT message is thrown: "<b>Strict Standards</b>:  Only variables should be passed by reference" and the reference is lost.

This was not the case in 5.1.1


Reproduce code:
---------------
function foo(&$a) {
    $a = 1;
}

foo($a = 0);
var_dump($a);


Expected result:
----------------
int(1)

Actual result:
--------------
int(0)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-16 21:48 UTC] messju at lammfellpuschen dot de
sorry, I just learned here:
http://www.php.net/manual/en/language.references.pass.php
that the result always was undefined.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC