Re: objects

From: Date: Mon, 03 Jul 2000 16:20:53 +0000
Subject: Re: objects
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4521@lists.php.net to get a copy of this message
Hi Remigiusz! On Mon, 03 Jul 2000, Remigiusz Sokolowski wrote: > Anybody knows if it's possible to get to handles/references to the php > object? And how to get or work around it? class A { var $a;} class B { function B { $this->_bar = new A();} function &foo() { return $this->_bar; } } $c = new B(); $d = &$c; // object reference, $d points to the same obj as $c $e = $d->foo(); echo $e->a; // return a reference to the _bar member and use it erm, and I discovered you should use: $e = &$d->foo(); if you want $e point to the same object as $d->_bar what else? -- teodor

« previous php.general (#4521) next »