Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46799 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5461 invoked from network); 19 Jan 2010 11:19:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2010 11:19:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=addw@phcomp.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=addw@phcomp.co.uk; sender-id=permerror 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:63393] helo=mint.phcomp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/06-22457-D45955B4 for ; Tue, 19 Jan 2010 06:19:44 -0500 Received: from addw by mint.phcomp.co.uk with local (Exim 4.63) (envelope-from ) id 1NXC7U-0002LR-8z; Tue, 19 Jan 2010 11:19:36 +0000 Date: Tue, 19 Jan 2010 11:19:36 +0000 To: Alexey Zakhlestin Cc: Christian Schneider , 'PHP Internals' Message-ID: <20100119111936.GP3978@phcomp.co.uk> Mail-Followup-To: Alexey Zakhlestin , Christian Schneider , 'PHP Internals' References: <4B54FC87.8070106@zend.com> <4B558DBF.6020100@cschneid.com> <0F4BC787-02F1-4C31-AD8A-0BD867769A7B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0F4BC787-02F1-4C31-AD8A-0BD867769A7B@gmail.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 01:55:32PM +0300, Alexey Zakhlestin wrote: > > On 19.01.2010, at 13:47, Christian Schneider wrote: > > > Alexey Zakhlestin wrote: > >> Would be nice if something like this worked too: > >> (new Class())->method(); > > > > If you *really* want to do this you can use a factory method: > > Class::create()->method(); > > I know. That's what I do if I need it. > Or just create temporary variable > > But, still, I want consistent syntax, which doesn't put limitations on me > this construct is an example of things, which many people take for granted and are shocked, when they discover, that they can't use it. > I saw a lot of questions on forums regarding it I am in favour of such things and get annoyed when it doesn't work. I get annoyed because things like this don't work: $a = '0123456789'[$i]; But I come from a C background and am a competent programmer. I have seen the argument that things like this will confuse novice programmers, maybe: but would they ever try to type something like that ? -- 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