#17052 [Dup->Bgs]: problem with & operator and variables
| From: | sniper@php.net | Date: | Tue, 25 Feb 2003 07:56:03 +0000 |
| Subject: | #17052 [Dup->Bgs]: problem with & operator and variables | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969351962@lists.php.net to get a copy of this message | ||
ID: 17052
Updated by: sniper@php.net
Reported By: jx at email dot cz
-Status: Duplicate
+Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 4.1.2
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.
Thank you for your interest in PHP.
bug #14645
Previous Comments:
------------------------------------------------------------------------
[2002-05-06 18:07:20] mfischer@php.net
Achja, and it's a documentation problem . . .
------------------------------------------------------------------------
[2002-05-06 18:04:05] mfischer@php.net
This is due that variables imported into functions with the global
statement are in fact references. There are open reports about this
issue, marking it as duplicate for now (#14645).
------------------------------------------------------------------------
[2002-05-06 17:46:46] jx at email dot cz
this is ok
<?
$a=&$b;
$a=5;
echo($b);
?>
but when I declare these variables as globals in a function it doesn't
work
<?
function foo() {
global $a, $b;
$a=&$b;
}
foo();
$a=5;
echo($b);
?>
It is probably allright. I didn't find anything about this problem.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17052&edit=1