object references

From: Date: Fri, 02 Aug 2002 11:32:28 +0000
Subject: object references
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-8141@lists.php.net to get a copy of this message
Hi, Somehow I am not getting this: Basically what I want is the following: I want to store a reference to an object into a variable and into an array. I have tried several different combinations but nothing worked as promised :-/ For example: $db =& new DB; $dbs[] =& $db; or $db = new DB; $dbs[] =& $db; or $db =& new DB; $dbs[] = $db; or I also tried moving things into the contructor: $db =& new DB; and in the constructor something like this: global $dbs; $db[] = $this; or something like this: global $dbs; $db[] =& $this; I really don’t know what else to try. In the end I have a copy of the object but not a reference to the same object. Best regards, Lukas Smith smith@dybnet.de _______________________________ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de info@dybnet.de

« previous php.pear.dev (#8141) next »