Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34305 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63608 invoked by uid 1010); 31 Dec 2007 18:10:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63593 invoked from network); 31 Dec 2007 18:10:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2007 18:10:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:33095] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/37-02434-A8039774 for ; Mon, 31 Dec 2007 13:10:19 -0500 Received: from MBOERGER-ZRH.corp.google.com (183-169.78-83.cust.bluewin.ch [83.78.169.183]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id EF0421B365C; Mon, 31 Dec 2007 19:10:17 +0100 (CET) Date: Sun, 30 Dec 2007 19:09:49 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <114209200.20071230190949@marcus-boerger.de> To: "Ryusuke SEKIYAMA" CC: internals@lists.php.net In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PATCH: Implementing closures in PHP From: helly@php.net (Marcus Boerger) Hello Ryusuke, generally I like both. But could you provide separate patches? marcus Friday, December 28, 2007, 5:45:03 PM, you wrote: >>any idea about the possibility of hash conflict? > How about this patch? > http://www.opendogs.org/pub/php-5.3dev-071228a.patch > This patch is PHP 5.3 version of the patch I have introduced > in my blog. (written in Japanese) > 1. http://d.hatena.ne.jp/rsky/20071126/1196077860 > 2. http://d.hatena.ne.jp/rsky/20071128/1196260732 > 3. http://d.hatena.ne.jp/rsky/20071130/1196426672 > This patch contains two features, anonymous function and > square bracket array syntax. > Anonymous function can be used in loop (does not exhaust memory > as create_function() in loop), work with opcode caches > and 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");' > foo > More examples are included in this archive: > http://www.opendogs.org/pub/php-5.3dev-071228-anon-patch.zip > -- > /** > * Ryusuke SEKIYAMA > * rsky0711@gmail.com > */ Best regards, Marcus