Re: Method/Function chaining?

From: Date: Sat, 14 Aug 2004 17:39:13 +0000
Subject: Re: Method/Function chaining?
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-12169@lists.php.net to get a copy of this message
Hello Dan, The answer that you are looking for can be found on the Zend site: http://www.zend.com/php5/articles/engine2-php5-changes.php#Heading13 -- Best regards, Jason mailto:jason@ionzoft.com Friday, August 13, 2004, 6:59:44 PM, you wrote: DO> Hello. DO> Excuse my ignorance on this, but I can't seem to find the answer I'm DO> looking for online... Will PHP5 be able to do "chaining" as some other DO> languages are able to do? DO> In other words... DO> ------------------------------ DO> <?php DO> class A DO> { DO> function A() { print "made an A...<br>\n"; } DO> function getB() { return new B(); } DO> } DO> class B DO> { DO> function B() { print "made a B...<br>\n"; } DO> function shout() { print "hey!!"; } DO> } DO> $a = &new A(); $a->>getB()->shout(); ?>> DO> ---------------------------- DO> This kind of polymorphism is something I'm used to, and I'm hoping it DO> won't result in a parse error in PHP5. =) DO> -- DO> Dan Ostrowski

« previous php.internals (#12169) next »