PHP 4.0 Bug #4552 Updated: references inside functions work with GLOBALS, not global
| From: | Bug Database | Date: | Tue, 30 May 2000 17:45:23 +0000 |
| Subject: | PHP 4.0 Bug #4552 Updated: references inside functions work with GLOBALS, not global | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-19788@lists.php.net to get a copy of this message | ||
ID: 4552
Updated by: stas
Reported By: bill@rsv.ricoh.com
Status: Closed
Bug Type: Scripting Engine problem
Assigned To:
Comments:
This is not bug. It goes as follows:
1. "global" means local ones become pointers to global ones
2. local fruit becomes pointer to the same as local rock
(which is "granite")
3. global rock becomes pointer to the same as global fruit
(which is "apple")
but local rock (and thus fruit) still point to "granite"
4. Now when function exits, local $fruit and $rock are destroyed,
and both $fruit and $rock point to "apple"
Think about it as if all variables in PHP are pointers to some entities.
Ask on the list if you need more guidance.
Full Bug description available at: http://bugs.php.net/version4/?id=4552