Re: PATCH: anonymous functions in PHP
| From: | Chad Daelhousen | Date: | Tue, 20 Mar 2007 13:27:59 +0000 |
| Subject: | Re: PATCH: anonymous functions in PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28480@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
I suspect that you could get away with JUST using global and/or static as they exist now, not introduce yet another scoping keyword, and anything that *NEEDS* to be done with an anonymous function can be done. Does anybody really *NEED* a variable whose scope is non-global and captured at the time of the func definition, carried over beyond the scope of that until it's executed?... Somehow I think you're just complicating it "because you can" rather than because anybody really NEEDS this.Objects provide for functions with state (methods and properties), in a way that doesn't cause headaches with scoping. So although I would love the convenience of closures in certain places, I can't argue that there is a NEED for them. -- Chad Daelhousen I've been programming for about 15 years, but it's only in the last couple that I've come to a real understanding of it all.