On Friday 20 June 2008, Larry Garfield wrote: > > function ($x, $y) use ($a, $b, &$c) {}; > > I am not sure if "use" is the clearest word to use there (wouldn't lexical > there make more sense?)
I agree. "use" for both namespaces and closures may not be a good idea. Otherwise +1 to this syntax for its low WTF-factor. Look like parameters. Behave like parameters. Also, allowing this for regular function definitions might be a nice long-term replacement for global. > I would be fine with requiring an explicit declaration of $this if it helped > avoid memory leaks. I would propose to always require explicit declaration of $this, even if there is no memory-leak problem. This would make it easier to distinguish plain lambdas from closures and would prevent closures from being created by accident. As functional programming is foreign to most PHP-developers, better to err on the side of being explicit. Gesundheit Wag -- Her vocabulary was as bad as, like, whatever. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php