Re: Re: PATCH: anonymous functions in PHP
| From: | Alexey Zakhlestin | Date: | Thu, 20 Dec 2007 06:57:09 +0000 |
| Subject: | Re: Re: PATCH: anonymous functions in PHP | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34117@lists.php.net to get a copy of this message | ||
On 12/20/07, Stanislav Malyshev <stas@zend.com> wrote:
> > I think we need it. In the current incarnation, anonymous functions
> > are so impractical to use, that it's a barrier. I think that is
> > unfortunate, because it could be an interesting and useful direction
> > to take for PHP. The users, who don't know what a closure is, could
>
> Direction like what?
being able to do the following (and not to worry about runtime
compilation) is a good reason on it's own:
array_filter($my_data, function($test){ return 3 === ($test % 4) });
--
Alexey Zakhlestin
http://blog.milkfarmsoft.com/