Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45972 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51281 invoked from network); 7 Nov 2009 23:29:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2009 23:29:32 -0000 X-Host-Fingerprint: 91.203.188.222 unknown Received: from [91.203.188.222] ([91.203.188.222:22774] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/F6-03668-AD206FA4 for ; Sat, 07 Nov 2009 18:29:30 -0500 Message-ID: <0F.F6.03668.AD206FA4@pb1.pair.com> To: internals@lists.php.net References: Date: Sun, 8 Nov 2009 02:29:23 +0300 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Posted-By: 91.203.188.222 Subject: Re: [PHP-DEV] Regarding constructions like func()[0] From: melfar@gmail.com ("melfar") Hey, Yep, I think there might be some caveats to that change. The original patch did not work on methods, so I've fixed that and also made the return value an rvalue, so that you can't attempt to modify the temporary value, the zend_check_writable_variable guard will yield an error. The updated patch can be found at http://bugs.php.net/bug.php?id=50003 I've also heard an opinion that adding this construction is just going to make things more complicated, but take this: chained -> operators are supported for return values and I'm only seeing code getting simpler because of that. Br, -melfar "mm w" <0xcafefeed@gmail.com> wrote: > Hi Melfar, from my point of view I am totally to make this a legal > call like in python or ruby java, > as I liked compact code I liked to avoid temp vars especially on a > read-only call, but it might require some effort there and the final > patch might be not so simple, anyway this is a community call, what I > can say about this kind of missing feature "sometimes, I can hear in > my office" : "PHP is a retarded language, PHP sucks or worst", my > point there, that is sometimes good to listen to people who are not > "passionate" by the language but just using it to do their job and be > paid. > > Cheers! > > On Sat, Nov 7, 2009 at 3:42 AM, melfar wrote: >> Hello! >> >> I have filed a bug (suggestion) at http://bugs.php.net/bug.php?id=50003 >> What do you think about enabling such a constructions in future versions >> of >> php? >> >> Br, >> -melfar >> >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >>