Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46830 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46421 invoked from network); 19 Jan 2010 22:54:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2010 22:54:58 -0000 Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=permerror Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain phcomp.co.uk designates 78.32.209.33 as permitted sender) X-PHP-List-Original-Sender: addw@phcomp.co.uk X-Host-Fingerprint: 78.32.209.33 freshmint.phcomp.co.uk Linux 2.6 Received: from [78.32.209.33] ([78.32.209.33:63081] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/C6-29385-E38365B4 for ; Tue, 19 Jan 2010 17:54:56 -0500 Received: from addw by mint.phcomp.co.uk with local (Exim 4.63) (envelope-from ) id 1NXMyG-0007ZR-KW; Tue, 19 Jan 2010 22:54:48 +0000 Date: Tue, 19 Jan 2010 22:54:48 +0000 To: Stanislav Malyshev Cc: Daniel Convissor , PHP Internals List Message-ID: <20100119225448.GG3978@phcomp.co.uk> Mail-Followup-To: Stanislav Malyshev , Daniel Convissor , PHP Internals List References: <4B54FC87.8070106@zend.com> <4B55EE56.8040104@lerdorf.com> <4B55FA44.1060601@zend.com> <20100119190836.GA17124@panix.com> <4B5608B2.8050308@zend.com> <20100119195724.GA5597@panix.com> <4B561191.2040700@zend.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B561191.2040700@zend.com> User-Agent: Mutt/1.4.2.2i Organization: Parliament Hill Computers Ltd Subject: Re: [PHP-DEV] function call chaining From: addw@phcomp.co.uk (Alain Williams) On Tue, Jan 19, 2010 at 12:09:53PM -0800, Stanislav Malyshev wrote: > Hi! > > >$eep->oop()->ork()->ah()->ah(); > > > >the newcomer will have to spend significant time rummaging around the > >source code to figure out what classes are involved. > > As opposed to: > $oop = $eep->oop(); > $ork = $oop->ork(); > $ah = $ork->ah(); > $ah2 = $ah->ah(); > > where it instantly becomes crystal clear! Come on, this argument of "I > could read any code without ever knowing anything about anything but you > feature broke it" is getting really stale. You couldn't, and the feature > changed nothing. +1 At least with $eep->oop()->ork()->ah()->ah() you don't have stray/unwanted variables hanging round to confuse (or be misused) later. -- Alain Williams Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php Past chairman of UKUUG: http://www.ukuug.org/ #include