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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: messju at lammfellpuschen dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 12:01:33 2025 UTC