|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26798 Reference is assigned locally
Submitted: 2004-01-05 14:27 UTC Modified: 2004-01-06 17:47 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ilia at manual dot ru Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.3.4 OS: Windows XP,Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ilia at manual dot ru
New email:
PHP Version: OS:


 [2004-01-05 14:27 UTC] ilia at manual dot ru
The script should output '1', but it outputs '0'.
Looks like the assignment is made locally.

But if I replace '$a =& $b' with '$GLOBALS['a'] =& $b'
the script will output '1' (right behaviour)

Reproduce code:

function f()
    global $a,$b;
    $a =& $b;

echo $a;

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-06 17:47 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 08:02:42 2024 UTC