Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91237 invoked from network); 15 Dec 2009 19:48:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Dec 2009 19:48:48 -0000 Authentication-Results: pb1.pair.com header.from=chris_se@gmx.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=chris_se@gmx.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.net designates 213.165.64.20 as permitted sender) X-PHP-List-Original-Sender: chris_se@gmx.net X-Host-Fingerprint: 213.165.64.20 mail.gmx.net Linux 2.6 Received: from [213.165.64.20] ([213.165.64.20:36297] helo=mail.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/C1-16228-F18E72B4 for ; Tue, 15 Dec 2009 14:48:48 -0500 Received: (qmail invoked by alias); 15 Dec 2009 19:48:38 -0000 Received: from p54A16E30.dip.t-dialin.net (EHLO chris-se.dyndns.org) [84.161.110.48] by mail.gmx.net (mp043) with SMTP; 15 Dec 2009 20:48:38 +0100 X-Authenticated: #186999 X-Provags-ID: V01U2FsdGVkX19pD4t7bWdpa5r0XXRYG5b4EW2YbrNWqkiLPoq/t4 pjrb1f31DeS12g Received: from [192.168.0.175] (HSI-KBW-091-089-022-117.hsi2.kabelbw.de [91.89.22.117]) by chris-se.dyndns.org (Postfix) with ESMTP id 069693F84 for ; Tue, 15 Dec 2009 20:48:04 +0100 (CET) Message-ID: <4B27E7A4.6030503@gmx.net> Date: Tue, 15 Dec 2009 20:46:44 +0100 User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: internals References: <4B01A4C2.8030602@gmx.net> <4B27DD0B.1070303@gmx.net> <6571303B-82D2-43E4-8550-E2B9420BA241@pooteeweet.org> In-Reply-To: <6571303B-82D2-43E4-8550-E2B9420BA241@pooteeweet.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 Subject: Closures and $this: Please vote! From: chris_se@gmx.net (Christian Seiler) 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).