Re: Re: PATCH: anonymous functions in PHP
| From: | Alexey Zakhlestin | Date: | Thu, 20 Dec 2007 08:18:41 +0000 |
| Subject: | Re: Re: PATCH: anonymous functions in PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34120@lists.php.net to get a copy of this message | ||
On 12/20/07, Antony Dovgal <tony@daylessday.org> wrote:
> On 20.12.2007 09:57, Alexey Zakhlestin wrote:
> > 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) });
>
> Oh, my..
> This code clearly demonstrates why a syntax like this should not be allowed. Ever.
you prefer cluttering namespace with a lot of oneliners?
currently, people prefer to use explicit cycles instead of
array_map/array_filter and that looks ugly (hides actual logic behind
syntax), but at least it is not as slow as create_function.
--
Alexey Zakhlestin
http://blog.milkfarmsoft.com/