Re: How can I do this -- method chaining
| From: | Stut | Date: | Wed, 30 Jan 2008 15:53:01 +0000 |
| Subject: | Re: How can I do this -- method chaining | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268329@lists.php.net to get a copy of this message | ||
Nathan Nobbe wrote:
On Jan 30, 2008 10:46 AM, Stut <stuttle@gmail.com <mailto:stuttle@gmail.com>> wrote:Seriously? You really need to read the emails you're replying to. I gave an example that did what the OP asked for. Then I went on to say that I would probably just use a static method. I never said I wasn't creating an instance in the example I posted. The "forcing it out of scope" was the crux of my point. However, if Jochem is right then it's kinda pointless with the current implementation of the GC, but may become relevant in the new GC. -Stut -- http://stut.net/Nathan Nobbe wrote:Actually no, I mean I would *just* use a static method. If there is no reason to instantiate an object, why would you? <http://stut.net/>you realize you are instantiating an class in the code you posted, right? from you post: $o = new Test(); if i didnt know any better, id call that an instantiation of the Test class ;) the only thing is you are forcing it out of scope by using a local variable to store the reference to the object.