A friend of mine asked me if I knew if this was possible in PHP4. class foo { var $bar = NULL; function foo() { $this->bar = new bar(); } function getBar() { return $this->bar; } } class bar { var $thing = NULL; function bar() { $this->thing = "Hello World!"; } function getThing() { return $this->thing; } } he wants to do something like this: $obj =& new foo; print $foo->getBar()->getThing(); is this possible in PHP4? I know that he can do a: print $obj->bar->getThing(); ..but he wants it to run some stuff in the functions that he is calling and wants to do it in one command if possible. -Robby -- /*************************************** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | robby@xxxxxxxxxxxxxxx * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting & Development ****************************************/
Attachment:
signature.asc
Description: This is a digitally signed message part