Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42615 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97013 invoked from network); 14 Jan 2009 02:35:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2009 02:35:26 -0000 Authentication-Results: pb1.pair.com header.from=xuefer@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=xuefer@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.142.189 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: xuefer@gmail.com X-Host-Fingerprint: 209.85.142.189 ti-out-0910.google.com Received: from [209.85.142.189] ([209.85.142.189:2289] helo=ti-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/10-30671-C6F4D694 for ; Tue, 13 Jan 2009 21:35:26 -0500 Received: by ti-out-0910.google.com with SMTP id u3so137983tia.17 for ; Tue, 13 Jan 2009 18:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6mnsms5kU80may+D0eRu6ijR6gbcUtQRlSWxXmvV9Dc=; b=FgdCXI76HHNu5bYICke150HBn5zVcUpvlm7P9jY6Dv/W+uKFpHgdk7zS4+kbcpT9xa 57H1jBTQJjHJKT/Q/V5KWxvCpIeObrRnnkq4wQmr4V3meCPXd9Fq571nqcH40V5t+PXD X2aknfbatcEypGZjgWqvCcRP+syTC3QawWT8g= 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:content-transfer-encoding; b=Fzux+gC8pCobuIHpqLEKaMgXBX0z18voD2M9RpZyvS2ha18FehLpCUsOKa/5DhRb/u vyDzS90RFibjBe8t6MdD+FbSBMmF6h/rdCi6nXAvIjdFovPaxn1DbAMqkiSU+lp4sPkt 6xbzBeWWBLQT2L8Zi4az0JI9qKk+7M9PdY48k= MIME-Version: 1.0 Received: by 10.110.14.3 with SMTP id 3mr1872020tin.2.1231900520909; Tue, 13 Jan 2009 18:35:20 -0800 (PST) In-Reply-To: <496D2074.3070303@zend.com> References: <1016989528.20090112233204@marcus-boerger.de> <496BCD33.4080703@zend.com> <133861245.20090113225847@marcus-boerger.de> <496D2074.3070303@zend.com> Date: Wed, 14 Jan 2009 10:35:20 +0800 Message-ID: <28139bc0901131835mec5f972w1bdb7bf9fdd8f20a@mail.gmail.com> To: Stanislav Malyshev Cc: Marcus Boerger , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] prototyping From: xuefer@gmail.com (Xuefer) just a note about it in javascript, "this" ($this in php) is a special variable in closure, "this" is always bound to the "object" of "object.method(...)" when it is called, whenever i want a "this" of closure creation time context, i use: var _this = this; return function() { _this.prop = 123; _this.method(); } so.. > I see no reason to have two contexts in closure - one bound one way and > another bound another way it's already 2 contexts in php: $this and $_LOCALSCOPE (which is not available in user code). and now $_CLOSURE context the reason you think there's only 1 context maybe because $this is implemented in $_LOCALSCOPE['this'] = &$this in php internally. :) > I think context is a context - it's where the closure was created. true, the $_CLOSURE context prototype can be useful in php. and like closure that ppl got used to javascript version of closure/prototype, there should be no big problem understanding it.