Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38361 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87560 invoked from network); 18 Jun 2008 18:29:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2008 18:29:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:19351] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/B0-03518-C1459584 for ; Wed, 18 Jun 2008 14:29:49 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Jun 2008 21:29:54 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Jun 2008 11:29:20 -0700 Message-ID: <485953F5.1070602@zend.com> Date: Wed, 18 Jun 2008 11:29:09 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Andi Gutmans CC: Christian Seiler , php-dev List References: <4856A547.3080801@gmx.net> <698DE66518E7CA45812BD18E807866CE01B11811@us-ex1.zend.net> <4858FCC7.5030305@gmx.net> <698DE66518E7CA45812BD18E807866CE01B70D73@us-ex1.zend.net> In-Reply-To: <698DE66518E7CA45812BD18E807866CE01B70D73@us-ex1.zend.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Jun 2008 18:29:20.0427 (UTC) FILETIME=[3961A7B0:01C8D171] Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP From: stas@zend.com (Stanislav Malyshev) Hi! > by reference ($GLOBALS["foo"] =& $var). Now that I think of this > example I'd actually prefer to see $LEXICALS[] or something similar The problem here might be that if we do something like $LEX[$foo] in runtime, we don't know which parts of parent's scope we need to preserve. While I like the syntax, it may not work this way. Which brings me to another point - how bad would it be if closure's lifetime would be limited to parent's lifetime? Of course, this would limit some tricks, but would allow some other - like this direct access to parent's scope. > - Minor implementation suggestion: I am not sure we need those flags > for closures and have those if() statements before function calls. We In any case I think we don't need to waste 2 bytes (or more with alignment) on something that's essentially 2 bits. I know it's nitpicking, but every little bit helps :) Of course, if we drop the flags the point is moot. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com