Re: Re: PATCH: anonymous functions in PHP

From: Date: Thu, 20 Dec 2007 18:06: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-34156@lists.php.net to get a copy of this message
That makes perfect sense to me as I see/use this sort of code in JavaScript.
Well, PHP is not Javascript - and BTW Javascript is a complex language and I don't think we should import that complexity into PHP.
The argument about making the filter a global function is not sensible to apply in all circumstances. In many cases the filter is only going to be of use in an array_filter() call, so now we would have 2 functions to do the work of 1.
No, we won't - both cases have only one function, if you don't count array_filter(), and two, if you do.
Maybe a syntax like this would be more appealing ... array_filter($my_data as $test) { return 4 === ($test % 4); }
No, it won't be. If you are looking for Scheme or Ruby, you know where to find it :) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#34156) next »