Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28409 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71632 invoked by uid 1010); 19 Mar 2007 05:43:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71617 invoked from network); 19 Mar 2007 05:43:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 05:43:57 -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 63.205.162.114 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.114 unknown Windows 2000 SP4, XP SP1 Received: from [63.205.162.114] ([63.205.162.114:63419] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/14-25106-C132EF54 for ; Mon, 19 Mar 2007 00:43:57 -0500 Received: from [127.0.0.1] ([192.168.17.2]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 18 Mar 2007 22:43:52 -0700 Message-ID: <45FE2312.1050506@zend.com> Date: Sun, 18 Mar 2007 22:43:46 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0b2 (Windows/20070116) MIME-Version: 1.0 To: Wez Furlong CC: internals@lists.php.net References: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> <45FDF031.4010508@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Mar 2007 05:43:53.0328 (UTC) FILETIME=[93EABF00:01C769E9] Subject: Re: [PHP-DEV] PATCH: anonymous functions in PHP From: stas@zend.com (Stanislav Malyshev) > I didn't make it do anything fancy with scoping; it would make the > implementation more complicated, and wouldn't fit so well with the way > that scoping works in PHP, in that you need to explicitly reference the > global scope to "break out" of your function scope. > > It would be cool if the lexical scope was inherited, but maybe not cool > enough to warrant making it work :) Well, making it work makes this thing closure. Otherwise it's just a nice way to save a couple of keystrokes :) Not to diminish your work, but there's a danger people would think it is closure because it looks like one (i.e., in other languages closures look exactly this way, e.g. Javascript). -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/