Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28510 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57839 invoked by uid 1010); 21 Mar 2007 03:07:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57824 invoked from network); 21 Mar 2007 03:07:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Mar 2007 03:07:35 -0000 Authentication-Results: pb1.pair.com header.from=pollita@php.net; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=pollita@php.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 140.211.166.39 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pollita@php.net X-Host-Fingerprint: 140.211.166.39 osu1.php.net Linux 2.4/2.6 Received: from [140.211.166.39] ([140.211.166.39:50104] helo=osu1.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/D2-20949-771A0064 for ; Tue, 20 Mar 2007 22:07:35 -0500 X-DomainKeys: Ecelerity dk_sign implementing draft-delany-domainkeys-base-01 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=mx; d=php.net; h=From:Subject:To:Date; b=qn6SgkWXw3fV+QjVBXRnTnrb3dICRWMov6XqgmPsvWGOzWfwzpMlFWxrw+0YTCV2 gw8q/jh2JiaCRdMEy6yusCfzWHLaMGnHc9o4zg5Q0fSexsp+ez97OMzPujnn0kn5 Authentication-Results: osu1.php.net smtp.user=pollita; auth=pass (LOGIN) X-Host-Fingerprint: 207.126.230.225 unknown Received: from [207.126.230.225] ([207.126.230.225:8132] helo=[10.72.106.237]) by osu1.php.net (ecelerity 2.1.1.11-rc1 r(13363/13364M)) with ESMTPSA (cipher=AES256-SHA) id 92/5C-26250-B52A0064 for ; Tue, 20 Mar 2007 19:11:23 -0800 Message-ID: <4600A170.7090209@php.net> Date: Tue, 20 Mar 2007 20:07:28 -0700 User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Stanislav Malyshev CC: Sean Coates , Wez Furlong , Andi Gutmans , internals@lists.php.net References: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> <45FDF031.4010508@zend.com> <45FE2312.1050506@zend.com> <45FED6D9.8030307@caedmon.net> <45FEDAE5.2010309@zend.com> <45FEE396.7040905@caedmon.net> <0757BDEA-65F5-4123-B647-060DCA84B4B0@omniti.com> <45FEEF52.1060002@zend.com> <1174336464.24632.110.camel@blobule> <45FEF9A5.4050409@zend.com> <1174338801.24632.124.camel@blobule> <45FEFDCE.7050100@zend.com> <1174339527.24632.129.camel@blobule> <45FF01FE.6070504@zend.com> <698DE66518E7CA45812BD18E807866CE185525@us-ex1.zend.net> <2b2f60dc7b3112ac164aba20fbddd29d@gravitonic.com> <460025EA.5050303@zend.com> <46002967.8030909@caedmon.net> <46003824.1000909@zend.com> <4600754B.100@php.net> <46007B21.1040001@zend.com> In-Reply-To: <46007B21.1040001@zend.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PATCH: anonymous functions in PHP From: pollita@php.net (Sara Golemon) Stanislav Malyshev wrote: >> $_SCOPE doesn't need to be that special... It can just be an object >> with overloaded array access... Whenever a dim is fetched for that >> object, check current_execute_data->prev->symbol_table for the >> variable and return that. > > Once again - current_execute_data->prev at *closure runtime* has nothing > common with the symbol table that closure is supposed to capture. The > symbol table is present at the *closure instantiation* time - i.e. when > $foo = function(...) {...} (1) > is executed, not when > $foo(...) (2) > is executed. (1) may be executed in scope entirely unrelated to (2) and > only in rare special cases scope (1) would precede scope (2). In many > other cases, totally unrelated scope would be predecessor of (2) and > getting values from there would be a big surprise to the user. Ah, I understand now. This isn't something which should be evaluated when the function is run, but rather when it's bound. No sir, I don't like it. -1 from me. -Sara