From: Ryusuke SEKIYAMA Date: Fri, 28 Dec 2007 16:45:03 +0000 Subject: Re: PATCH: Implementing closures in PHP Groups: php.internals Request: Send a blank email tointernals+get-34272@lists.php.net to get a copy of this message
>any idea about the possibility of hash conflict?How about this patch?http://www.opendogs.org/pub/php-5.3dev-071228a.patchThis patch is PHP 5.3 version of the patch I have introducedin my blog. (written in Japanese)1.http://d.hatena.ne.jp/rsky/20071126/11960778602.http://d.hatena.ne.jp/rsky/20071128/11962607323.http://d.hatena.ne.jp/rsky/20071130/1196426672This patch contains two features, anonymous function andsquare bracket array syntax.Anonymous function can be used in loop (does not exhaust memoryas create_function() in loop), work with opcode cachesand also can be called directly like JavaScript's one.For example:% php -r 'print_r(array_map(function($n){ return $n * $n; }, [1, 2, 3]));'Array( [0] => 1 [1] => 4 [2] => 9)% php -r 'function($str){ echo $str, "\n"; }("foo");'fooMore examples are included in this archive:http://www.opendogs.org/pub/php-5.3dev-071228-anon-patch.zip-- /** * Ryusuke SEKIYAMA * rsky0711@gmail.com */
Thread (168 messages)
- Wez Furlong
- Jan Lehnardt
- Wez FurlongRe: PATCH: anonymous functions in PHP
- Stanislav Malyshev
- Wez Furlong
- Stanislav Malyshev
- Christian Schneider
- Sean Coates
- Stanislav Malyshev
- Sean Coates
- Wez Furlong
- Sean Coates
- Stanislav Malyshev
- Robert Cummings
- Stanislav Malyshev
- Robert Cummings
- Stanislav Malyshev
- Robert Cummings
- Stanislav Malyshev
- Robert Cummings
- Andi GutmansRE: [PHP-DEV] PATCH: anonymous functions in PHP
- Stanislav MalyshevRe: PATCH: anonymous functions in PHP
- Wez FurlongRe: PATCH: anonymous functions in PHP
- Sean Coates
- Wez Furlong
- Richard Lynch
- Richard Lynch
- David Zülke
- Antony Dovgal
- Sebastian Bergmann
- Richard Lynch
- Andrei Zmievski
- troels knak-nielsenRe: PATCH: anonymous functions in PHP
- Stanislav MalyshevRe: Re: PATCH: anonymous functions in PHP
- troels knak-nielsen
- Stanislav Malyshev
- Lars Strojny
- Alexey Zakhlestin
- troels knak-nielsen
- Jeff Moore
- Larry Garfield
- Jeff Moore
- Larry Garfield
- Christian SeilerPATCH: Implementing closures in PHP (was: anonymous functions in PHP)
- Alexey Zakhlestin
- Antony DovgalRe: Re: PATCH: anonymous functions in PHP
- Ryusuke SEKIYAMARe: PATCH: Implementing closures in PHP
«previous | php.internals (#34272) | next » |
---|