#26798 [Opn->Bgs]: Reference is assigned locally
| From: | sniper@php.net | Date: | Tue, 06 Jan 2004 22:47:23 +0000 |
| Subject: | #26798 [Opn->Bgs]: Reference is assigned locally | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52884@lists.php.net to get a copy of this message | ||
ID: 26798
Updated by: sniper@php.net
Reported By: ilia at manual dot ru
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Windows XP,Linux
PHP Version: 4.3.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2004-01-05 14:27:28] ilia at manual dot ru
Description:
------------
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:
---------------
$b=1;
$a=0;
function f()
{
global $a,$b;
$a =& $b;
}
f();
echo $a;
Expected result:
----------------
1
Actual result:
--------------
0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26798&edit=1