Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48667 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75737 invoked from network); 6 Jun 2010 20:10:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2010 20:10:23 -0000 Authentication-Results: pb1.pair.com header.from=jille@quis.cx; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jille@quis.cx; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain quis.cx from 85.223.64.56 cause and error) X-PHP-List-Original-Sender: jille@quis.cx X-Host-Fingerprint: 85.223.64.56 56-64-223.ftth.xms.internl.net Received: from [85.223.64.56] ([85.223.64.56:56232] helo=istud.quis.cx) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/61-35609-9A00C0C4 for ; Sun, 06 Jun 2010 16:10:21 -0400 Received: from [192.168.0.4] (unknown [192.168.0.4]) by istud.quis.cx (Postfix) with ESMTP id D8FFC610833; Sun, 6 Jun 2010 22:10:14 +0200 (CEST) Message-ID: <4C0C009C.4030006@quis.cx> Date: Sun, 06 Jun 2010 22:10:04 +0200 User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Felipe Pena CC: Stas Malyshev , internals@lists.php.net References: <4C089491.1050305@sugarcrm.com> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Suggestion: echo function(var)[0]; From: jille@quis.cx (Jille Timmermans) Felipe Pena schreef: > Hi! > > 2010/6/4 Stas Malyshev > >> Hi! >> >> >> function call chaining (f()() if f() returns function), and array >>> dereferencing (f()[0]) - (Stas) >>> >> I did patch for f()() - it's referenced at >> http://wiki.php.net/rfc/fcallfcall - but not for f()[] - didn't have time >> for that yet. >> >> It should not be too hard to do, one just has to be careful with refcounts >> so that the returned result could be freed properly and without hurting the >> referred element. >> > > I wrote a patch, but I cannot test all cases, so I'm not sure if is okay at > all. > > What about this approach: http://felipe.ath.cx/diff/array_dereference.diff ? > If the patch is really that easy I'm gonna kill someone. (Or marry you, depending on my mood :))