Bug #17052 Updated: problem with & operator and variables
| From: | mfischer@php.net | Date: | Mon, 06 May 2002 22:07:20 +0000 |
| Subject: | Bug #17052 Updated: problem with & operator and variables | ||
| References: | 1 | Groups: | php.bugs php.doc |
| Request: | Send a blank email to php-bugs+get-7084@lists.php.net to get a copy of this message | ||
ID: 17052
Updated by: mfischer@php.net
Reported By: jx@email.cz
Status: Duplicate
-Bug Type: Performance problem
+Bug Type: Documentation problem
Operating System: Linux
PHP Version: 4.1.2
New Comment:
Achja, and it's a documentation problem . . .
Previous Comments:
------------------------------------------------------------------------
[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@email.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