Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45998 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63383 invoked from network); 10 Nov 2009 17:59:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2009 17:59:15 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:48624] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/84-38546-1F9A9FA4 for ; Tue, 10 Nov 2009 12:59:15 -0500 Received: from us-gw1.zend.com (unknown [192.168.16.5]) by il-mr1.zend.com (Postfix) with ESMTP id D40CD504E4; Tue, 10 Nov 2009 19:46:40 +0200 (IST) Received: from [192.168.27.1] ([192.168.27.1]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Nov 2009 09:59:06 -0800 Message-ID: <4AF9A9E2.4000004@zend.com> Date: Tue, 10 Nov 2009 09:58:58 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: RQuadling@googlemail.com CC: melfar , internals@lists.php.net References: <0F.F6.03668.AD206FA4@pb1.pair.com> <10845a340911072344h1187694xf1714dd8b97ac58e@mail.gmail.com> In-Reply-To: <10845a340911072344h1187694xf1714dd8b97ac58e@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Nov 2009 17:59:06.0508 (UTC) FILETIME=[7EE014C0:01CA622F] Subject: Re: [PHP-DEV] Regarding constructions like func()[0] From: stas@zend.com (Stanislav Malyshev) Hi! > Whilst you are all thinking about this, how about ... > > $value = (function(){return $x;})(); I tried implementing that but it's not straightforward because you need to keep the result of first call while everything inside () is calculated (which can be any number of expressions including function calls etc.) which wouldn't work with naive implementation, since by default it doesn't have correct refcount to be preserved and if you change it you need to add cleanup somewhere. BTW I'm not sure the ()[] works there too - did you try to put some complex expressions with multiple fcalls inside []? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com