From:             [EMAIL PROTECTED]
Operating system: Linux Mandrake
PHP version:      4.0.4pl1
PHP Bug Type:     Scripting Engine problem
Bug description:  new operator behaves in a really strange way

$objectlist=array();
class MyClass
{
  function MyClass()
  {
    global $objectlist;
    // Save the reference for later use
    $objectList[]=&$this;
  }
};

// the object referred to by $myobject is NOT in the array
$myobject = new MyClass();
// $myobject2 exists in the array
$myobject2 =& new MyClass();

It appears that there is an object being copied when returning from the constructor. 
What am I doing wrong?

I'm not supposed to return anything from the constuctor.


-- 
Edit Bug report at: http://bugs.php.net/?id=9479&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to