Re: [RFC] new foo()->bar()
| From: | Gustavo Lopes | Date: | Fri, 26 Nov 2010 22:04:17 +0000 |
| Subject: | Re: [RFC] new foo()->bar() | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50609@lists.php.net to get a copy of this message | ||
On Fri, 26 Nov 2010 20:25:32 -0000, Peter Lind <peter.e.lind@gmail.com> wrote:
It seems fairly handy and I've been in situations where I wanted to do something like that - in fact, I use factories to achieve something similar. However, the more I use it, the more it feels like introducing code smells into my code. You're essentially instantiating an object only to immediately throw it away.Not necessarily; you could be calling the method for the collateral effects and that method return the object itself. This is not that uncommon. +1 -- Gustavo Lopes