Re: php4 objects
| From: | Chris | Date: | Wed, 13 Oct 2004 02:59:00 +0000 |
| Subject: | Re: php4 objects | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199335@lists.php.net to get a copy of this message | ||
Robby Russell wrote:
A friend of mine asked me if I knew if this was possible in PHP4. class foo { var $bar = NULL; function foo() {Chris$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 No, he can't. That functionality WAS added in PHP 5 though.