On 8/22/05, Stanislav Malyshev <[EMAIL PROTECTED]> wrote:
> MB>>> * Anonymous functions. The real stuff, not just some odd string
> MB>>> passed to create_function().
> MB>>
> MB>>There were some others already asking for this, maybe we should at least
> MB>>give it a thought if it is doable at all, anybody?
>
> Just out of curiosity, what's bad in create_function and how "real" ones
> should be different?
"Real" anonymous functions (as in, closures) should be able to capture
variables from its lexical environment, e.g.:
function adder($a) {return function($b) {return $a+$b;}}
function index($i) {return function($a) {return $a[$i];}}
I'm sure you can think of useful examples.
Cheers,
Michael
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php