Re: PHP4: calling method on returned object
| From: | Jasper Bryant-Greene | Date: | Thu, 30 Mar 2006 11:16:43 +0000 |
| Subject: | Re: PHP4: calling method on returned object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232912@lists.php.net to get a copy of this message | ||
Karl Glennon wrote:
[snip]
I expected to have the ability to get the url of a location's map with the floowing statement: print $this->Location->GetMap()->GetUrl(); [snip]
Is there any other syntax in PHP4 to allow me to concisely call a method on a return object? eg. ($this->Location->GetMap())->GetUrl() .. which doens't work.In short, no. That syntax was introduced in PHP5. For OO work, I would strongly recommend upgrading to PHP5 as there are many other important OO features that simply are not available in PHP4. -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM jasper@album.co.nz 021 708 334