php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40111 call-time pass by reference is either ambiguous or wrong.
Submitted: 2007-01-12 16:57 UTC Modified: 2007-01-15 10:04 UTC
From: colder@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.0 OS: Irrelevant
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: colder@php.net
New email:
PHP Version: OS:

 

 [2007-01-12 16:57 UTC] colder@php.net
Description:
------------
"Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If ..."

But the argument is still passed by reference.

I believe the error message doesn't reflect the way it works and should for that reason be updated.

The modification I propose can be found here:

http://patches.colder.ch/zend_compile-1.647.2.27.2.26.patch?markup


Reproduce code:
---------------
function foo(&$a){$a++;}; 
function bar($a){$a++;} 
$val1 = 1; foo(&$val1); echo $val1."\n"; //2
$val2 = 1; bar(&$val2); echo $val2; //2


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-15 10:04 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 19:01:36 2025 UTC