Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48661 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22146 invoked from network); 5 Jun 2010 19:28:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2010 19:28:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:52805] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/44-25133-F65AA0C4 for ; Sat, 05 Jun 2010 15:28:48 -0400 Received: by fxm16 with SMTP id 16so1546449fxm.29 for ; Sat, 05 Jun 2010 12:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=BYZMpQ72XpeAlOhu+fMCa/acvOUqmORwruzUdtTgKsE=; b=FWkSKx6jYQQDQ7gDHN/2f2qXu83sKY2Jwycw4Et00voUzoRzcBW5ndChb5XSZ0VpB7 A77+QurMQ2Knkl2gtiWYeIbOxSyJwgayFWPGxadCGdn3eeGs1tkW32HmnfPzQR5mHSp6 Eh8zmvYDFlPxX61I0663xy5TdkGx8XROUpok4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=NMvaG3D4mwYvdhRBKnrXB0faaGqps6tLR3ZBSZcjw5pSzyNDUBs+zDopjf1Vvd/YiD pTfAbWOA6rekT3Y2MaTVND8O/L0QYTv29GRS+1vtfVNicB1nPonjzTHPGKYsLklG+yAC HLMH7o3fQ+IpvakCFkRHxMduiGf9mKtauYZGc= MIME-Version: 1.0 Received: by 10.103.80.5 with SMTP id h5mr4429412mul.82.1275766125001; Sat, 05 Jun 2010 12:28:45 -0700 (PDT) Received: by 10.103.160.17 with HTTP; Sat, 5 Jun 2010 12:28:44 -0700 (PDT) In-Reply-To: <4C089491.1050305@sugarcrm.com> References: <4C089491.1050305@sugarcrm.com> Date: Sat, 5 Jun 2010 16:28:44 -0300 Message-ID: To: Stas Malyshev Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e65c88e8b27cc204884d7288 Subject: Re: [PHP-DEV] Suggestion: echo function(var)[0]; From: felipensp@gmail.com (Felipe Pena) --0016e65c88e8b27cc204884d7288 Content-Type: text/plain; charset=UTF-8 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 ? -- Regards, Felipe Pena --0016e65c88e8b27cc204884d7288--