Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50609 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79931 invoked from network); 26 Nov 2010 22:04:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2010 22:04:37 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:48714] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/62-00463-2FE20FC4 for ; Fri, 26 Nov 2010 17:04:34 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 0453C70003AF for ; Fri, 26 Nov 2010 22:04:31 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id 4gCiuHYbbUoJ for ; Fri, 26 Nov 2010 22:04:30 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id C95B470003A7 for ; Fri, 26 Nov 2010 22:04:30 +0000 (WET) Received: from cataphract-old (195.61.136.95.rev.vodafone.pt [95.136.61.195]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id ADB4C2006C57 for ; Fri, 26 Nov 2010 22:04:30 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: Date: Fri, 26 Nov 2010 22:04:17 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_IST?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.00 (Win32) Subject: Re: [PHP-DEV] [RFC] new foo()->bar() From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Fri, 26 Nov 2010 20:25:32 -0000, Peter Lind 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