Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47836 invoked from network); 23 Jul 2008 16:26:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2008 16:26:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=moriyoshi@at.wakwak.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=moriyoshi@at.wakwak.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain at.wakwak.com designates 219.103.130.24 as permitted sender) X-PHP-List-Original-Sender: moriyoshi@at.wakwak.com X-Host-Fingerprint: 219.103.130.24 mgdnp1.nw.wakwak.com Received: from [219.103.130.24] ([219.103.130.24:63753] helo=mgdnp1.nw.wakwak.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/09-12534-0AB57884 for ; Wed, 23 Jul 2008 12:26:12 -0400 Received: from vckyb1.nw.wakwak.com (postfix@vckyb1.nw.wakwak.com [211.9.230.144]) by mgdnp1.nw.wakwak.com (8.14.3/8.14.3/2008-07-17) with SMTP id m6NGQ4Db054150 for ; Thu, 24 Jul 2008 01:26:04 +0900 (JST) (envelope-from moriyoshi@at.wakwak.com) Received: from at.wakwak.com (at.wakwak.com [211.9.230.135]) by vckyb1.nw.wakwak.com (Postfix) with ESMTP id 3F2FE30060 for ; Thu, 24 Jul 2008 01:26:04 +0900 (JST) Received: from [10.1.6.29] (c-gate0.bioinfo.sfc.keio.ac.jp [133.27.19.40]) (user=moriyoshi mech=CRAM-MD5) by at.wakwak.com (8.14.3/8.14.3/2008-07-15) with ESMTP/inet id m6NGQ4ch057183; Thu, 24 Jul 2008 01:26:04 +0900 (JST) (envelope-from moriyoshi@at.wakwak.com) In-Reply-To: <54FF091B-A4BE-4C3E-9783-D2DE93D6AF31@at.wakwak.com> References: <54FF091B-A4BE-4C3E-9783-D2DE93D6AF31@at.wakwak.com> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Thu, 24 Jul 2008 01:21:35 +0900 To: Moriyoshi Koizumi X-Mailer: Apple Mail (2.753.1) Subject: RFC question (Re: [PHP-DEV] [PATCH] Allow use($var..) statement ubiquitously) From: moriyoshi@at.wakwak.com (Moriyoshi Koizumi) I would like to keep this as a RFC page in wiki.php.net. Are there any conventions or rules that I should keep in mind? (or just-not- supposed-to-do-that-because-your-proposal-is-stupid-and-will-never-be- accepted?) Moriyoshi On 2008/07/18, at 8:23, Moriyoshi Koizumi wrote: > Hi, > > Attached are the patches that allow the "use" statement that was > introduced with closures to appear within every function statement > except method definitions. I think this feature is a good addition > because it resolves inconsistency between closures and unticked > functions. In a nutshell, > > function foo() use (&$some_globals) { > echo $some_globals; > } > ?> > > is equivalent to > > function foo() { > global $some_globals; > echo $some_globals; > } > ?> > > While, > > function bar() { > $some_local_var = ''; > function fubar() use (&$some_local_var) { > echo $some_local_var; > } > } > ?> > > and > > function bar() { > function fubar() { > global $some_local_var; > echo $some_local_var; > } > } > ?> > > are of course not the same. HEAD-20080718.patch.diff.txt> PHP_5.3-20080718.patch.diff.txt> > Moriyoshi > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php