Re: [PATCH] Allow use($var..) statement ubiquitously
| From: | Moriyoshi Koizumi | Date: | Fri, 18 Jul 2008 10:09:53 +0000 |
| Subject: | Re: [PATCH] Allow use($var..) statement ubiquitously | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39081@lists.php.net to get a copy of this message | ||
On 2008/07/18, at 19:06, Richard Quadling wrote:
2008/7/18 Moriyoshi Koizumi <moriyoshi@at.wakwak.com>: running test1.php ends up with two lines of "bar", surprisingly. This is somewhat confusing, but surely one of the things that could not ever be done. This might be a great help when you use a PHP-script file as a mark-up template. Moriyoshi It was my understanding that include-d functions were added to the global scope (or I suppose the active namespace). So, in that context, function b() use($a) {} should be getting the $a from the global scope where $a == "foo". I would say that getting 2 "bar"s is wrong.Lexical scopes are completely irrelevant to which namespace the function belongs to. Moriyoshi