#25302 [Opn->Bgs]: referancing object members in GLOBALS does not work properly
| From: | sniper@php.net | Date: | Mon, 08 Sep 2003 00:05:35 +0000 |
| Subject: | #25302 [Opn->Bgs]: referancing object members in GLOBALS does not work properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47216@lists.php.net to get a copy of this message | ||
ID: 25302
Updated by: sniper@php.net
Reported By: rani_s_m2001 at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: windows xp
PHP Version: 4.3.2
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
There are dozens of other ways too to "shoot-yourself-in-foot"..just
don't do it.
Previous Comments:
------------------------------------------------------------------------
[2003-08-28 15:05:37] rani_s_m2001 at yahoo dot com
Description:
------------
when creating an object on the globals array, referancing its members
to a variable does not work properly.
it works as expected in normal arrays.
Reproduce code:
---------------
<?php
class a
{
var $r;
function a()
{
$this->r=1;
}
}
$GLOBALS["a"]=&new a();
$a=&$GLOBALS["a"]->r;
print($a);
$GLOBALS["a"]->r=2;
//should print 2, instead prints 1
print($a);
?>
Expected result:
----------------
12
Actual result:
--------------
11
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25302&edit=1