Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38477 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5958 invoked from network); 20 Jun 2008 16:19:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2008 16:19:37 -0000 Authentication-Results: pb1.pair.com header.from=waqner@gmx.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=waqner@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: waqner@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:58493] helo=mail.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/71-31321-898DB584 for ; Fri, 20 Jun 2008 12:19:37 -0400 Received: (qmail invoked by alias); 20 Jun 2008 16:19:33 -0000 Received: from p5087B6D2.dip.t-dialin.net (EHLO p5087b6d2.dip.t-dialin.net) [80.135.182.210] by mail.gmx.net (mp007) with SMTP; 20 Jun 2008 18:19:33 +0200 X-Authenticated: #27239598 X-Provags-ID: V01U2FsdGVkX1/Cb2g1OLXCg1VFvaubsXG1IztGk+YTt/o+bugVZc voJYTnqJ7mMYFO To: internals@lists.php.net Date: Fri, 20 Jun 2008 18:19:31 +0200 User-Agent: KMail/1.9.9 Cc: "Chris Stockton" References: <4856A547.3080801@gmx.net> <200806201633.08425.waqner@gmx.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200806201819.32071.waqner@gmx.net> X-Y-GMX-Trusted: 0 Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP From: waqner@gmx.net (Alexander Wagner) On Friday 20 June 2008, Chris Stockton wrote: > No one at all thinks: > function foo($x, $y) use $a, $b, $c { > } > > Looks awkward and a little out of place It certainly is new and different in PHP, but I don't see a reason why this should be hard to get used to. Also, it works for Java exceptions. void foo () throws IOException { } > we should at least import into the scope in a way consistent with how we do > it already with GLOBAL right? Just seems a lot cleaner IMO. At first I also thought that it would be nice to be consistent with global. Then I realized that global is inconsistent with everything else in PHP (by using references instead of copies by default), which is probably why it's use is discouraged in favor of $GLOBALS. I think it makes much more sense to make lexically (and globally) scoped variables look like declared exceptions in Java and make them part of the interface of the function, than to make them look like local variable declarations in C. Why allow the declaration of a reference to a global or lexical variable in the middle of a loop? Gesundheit Wag -- One hundred little bugs in the code One hundred little bugs. Fix a bug, link the fix in, One hundred little bugs in the code.