|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25302 referancing object members in GLOBALS does not work properly
Submitted: 2003-08-28 15:05 UTC Modified: 2003-09-07 20:05 UTC
From: rani_s_m2001 at yahoo dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.2 OS: windows xp
Private report: No CVE-ID: None
 [2003-08-28 15:05 UTC] rani_s_m2001 at yahoo dot com
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:

 class a
  var $r;
  function a()


 $GLOBALS["a"]=&new a();

//should print 2, instead prints 1


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-07 20:05 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

There are dozens of other ways too to "shoot-yourself-in-foot"..just don't do it.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 01:01:28 2024 UTC