Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60181 invoked from network); 3 Jul 2008 09:07:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2008 09:07:57 -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:45910] helo=mail.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/C2-37564-BE69C684 for ; Thu, 03 Jul 2008 05:07:57 -0400 Received: (qmail invoked by alias); 03 Jul 2008 09:07:52 -0000 Received: from p54A1525C.dip.t-dialin.net (EHLO chris-se.dyndns.org) [84.161.82.92] by mail.gmx.net (mp046) with SMTP; 03 Jul 2008 11:07:52 +0200 X-Authenticated: #186999 X-Provags-ID: V01U2FsdGVkX1/l9Xc65znlSVE2lZFO4ySyOWRVHMmhI8Rwt6KXcR 2V01WUX0La+Qfb Received: from [192.168.0.175] (HSI-KBW-091-089-005-213.hsi2.kabelbw.de [91.89.5.213]) by chris-se.dyndns.org (Postfix) with ESMTP id A4B8510458; Thu, 3 Jul 2008 10:48:41 +0200 (CEST) Message-ID: <486C96A8.3070501@gmx.net> Date: Thu, 03 Jul 2008 11:06:48 +0200 User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Larry Garfield CC: internals@lists.php.net References: <486B6960.4030705@gmx.net> <200807022013.14288.larry@garfieldtech.com> In-Reply-To: <200807022013.14288.larry@garfieldtech.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 Subject: Re: [PHP-DEV] [RFC] Closures: updated proposal and patch From: chris_se@gmx.net (Christian Seiler) Hi, > 1) The RFC page says that closures pass by value by default. Although it is > not stated, am I correct in saying that due to the way resources and objects > (and presumably therefore lambdas) are handled they will still have the > effect of passing by reference anyway, just as with a function parameter? Yes, of course. :) > 2) It is unclear from the RFC if static class closures (I am not fond of that > syntax, I grant) are the only ones that won't import $this. Is the suggested > detection optimization not included, and therefore it's up to the programmer > to avoid dangling references that keep stray classes around? It's up to the programmer for now, static => no $this, no static => $this. > 3) Can __invoke() accept parameters, Yes. > 4) The ability to reflect and then call a function or method as a closure > sounds highly nifty. However, I am unclear on why it is necessary to pass in > the $this to use. In that case, wouldn't it make more sense to use > ReflectionObject() in the first place so that the $this is implicitly known? Probably. But if we start picking on every detail of the patch until it is absolutely perfect, it will never get committed, not even to HEAD. So I propose that it should be committed to HEAD (as long as there are no major objections) and then worry about tiny details afterwards. > 5) There's a couple spelling and grammar errors. :-) Feel free to correct them if you have access to the wiki. Regards, Christian