On 17 May 2004 22:26, Jeff Schmidt wrote:

> Hello,
>    Say I have object A, with method getObjectB(), which returns a
> reference to object2. 
> 
> Is there a way to do something like
> $A->getObjectB()->methodFromObjectB();
> 
> ??
> 
> When I try that, I get a parse error? Is this simply not
> possible with
> PHP, or is the syntax just a little different?
> 
> I mean, I could:
> 
> $b = $A->getObjectB();
> $b->methodFromObjectB();

That's how you have to do it in PHP 4.  In PHP 5, you will be able to use the 
collapsed version -- it's one of the OO improvements.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to