Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46437 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37143 invoked from network); 15 Dec 2009 23:50:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Dec 2009 23:50:23 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.171 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.216.171 mail-px0-f171.google.com Received: from [209.85.216.171] ([209.85.216.171:44797] helo=mail-px0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/30-33900-EB0282B4 for ; Tue, 15 Dec 2009 18:50:23 -0500 Received: by pxi1 with SMTP id 1so268841pxi.29 for ; Tue, 15 Dec 2009 15:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=VpMGw5mNWA0dT0fba5AhDs654nl9DK/xOOfdIy3qdcY=; b=m3sBmFpunMLwowwwa/xNoPuvPCNOra4ANjAa/6hI+PG5ijsWpN5F1X+Q+u4y/T58VN fXVe3PA26EI8CSkstgiYDVaUhDfGUJ9Dy60Wvhn3EZvZFlVHg8vFiIEbg2NBxyVw7pX+ TRr1589Y719LLaP47SV21lYwkA7f9WSpvRtZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=iEwnefYzKefVeLZAgCKX57VjIjhddpoLgzx7igPEGTsddKK69cQ/65QrQ0M5vF2vXw vyC6hbSQ2qcDrRcct2ehi2ZkM+FvvXGBtRSGIdWypLtUnH4x8CvGjN8TZIYatuj8I2R/ N5L+UnIgzL44XXnazg7Q0BqpBtULU919VSBh4= MIME-Version: 1.0 Sender: tjerk.meesters@gmail.com Received: by 10.142.249.19 with SMTP id w19mr146221wfh.199.1260921019531; Tue, 15 Dec 2009 15:50:19 -0800 (PST) In-Reply-To: <4B2812B6.5000305@gmail.com> References: <4B01A4C2.8030602@gmx.net> <4B27DD0B.1070303@gmx.net> <6571303B-82D2-43E4-8550-E2B9420BA241@pooteeweet.org> <4B27E7A4.6030503@gmx.net> <4B2812B6.5000305@gmail.com> Date: Wed, 16 Dec 2009 07:50:19 +0800 X-Google-Sender-Auth: b00edca99e94b729 Message-ID: To: "Ionut G. Stan" , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Closures and $this: Please vote! From: datibbaw@php.net (Tjerk Anne Meesters) Hi, Maybe I don't exactly understand the need for closureProperty(); also, I haven't read the rfc ;-) My understanding would be that you can treat it as a callable object, like so: $a = function($msg) { echo $this->id, ": ", $msg, " [ calls: ", ++$this->calls, "]"; } $a->id = 123; $a("hello world"); If that can be done with A or A+ my vote goes for either one. I don't think rebinding will be very useful or intuitive though (unless one would want to use it as a drop-in method for their classes). On 12/16/09, Ionut G. Stan wrote: > A+, but I'm not an internal dev. > > > On 12/15/2009 21:46, Christian Seiler wrote: >> Hi Lukas, >> >>> Call for a vote. This time around people cannot claim to not have had >>> time to review the issue. Also back then we tried to play it safe >>> because of the short time before we were to release. This time there is >>> more time for this to mature if needed inside svn. >> >> Ok, so then I call for a vote. Again, here are the options: >> >> (0): No $this in closures, keep it that way. (keep PHP 5.3 behavior) >> >> (A): Original closures implementation: >> $this is always the object context at >> closure creation. No possibility to do >> $someObject->closureProperty(...) and thus >> no possibility to extend objects! >> >> (C): Javascript-like behaviour: Bind $this only when calling >> the closure as object method, else $this is undefined. >> >> (D): JS-like behaviour on top of (A). >> Please look at the RFC as to why I consider it to be a >> *REALLY*, *REALLY* bad idea. >> >> (A+): (A) + Closure::bind& Closure->bindTo for rebinding >> if this is wanted& the possibility to call a closure as an object >> method. (See last section of RFC for details) >> >> My vote: (A+) >> >> Regards, >> Christian >> >> PS: Note that I removed (B) from the possible options since I believe it >> to be an EXTREMELY bad idea if one thinks it through. It was only added >> to the RFC in order to give an overview over what was discussed >> previously. Unless someone can make an extremely compelling case why I'm >> wrong in this respect, I will refuse to implement (B). >> > > -- > Ionut G. Stan > I'm under construction | http://blog.igstan.ro/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -- Tjerk