Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28439 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76039 invoked by uid 1010); 19 Mar 2007 20:20:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76024 invoked from network); 19 Mar 2007 20:20:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 20:20:59 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:3520] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/FD-01604-7A0FEF54 for ; Mon, 19 Mar 2007 15:20:58 -0500 Received: (qmail 53392 invoked by uid 98); 19 Mar 2007 20:20:55 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-1.25 (clamdscan: 0.88.7/2871. Clear:RC:1(127.0.0.1):. Processed in 0.086541 secs); 19 Mar 2007 20:20:55 -0000 X-Qmail-Scanner-Mail-From: ceo@l-i-e.com via o2.hostbaby.com X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.086541 secs) Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 20:20:55 -0000 Received: from 216.230.84.67 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Mon, 19 Mar 2007 15:20:55 -0500 (CDT) Message-ID: <54922.216.230.84.67.1174335655.squirrel@www.l-i-e.com> In-Reply-To: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> References: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> Date: Mon, 19 Mar 2007 15:20:55 -0500 (CDT) To: "Wez Furlong" Cc: internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] PATCH: anonymous functions in PHP From: ceo@l-i-e.com ("Richard Lynch") On Sun, March 18, 2007 6:41 pm, Wez Furlong wrote: > We've been daydreaming about the ability to do something like this in > PHP: > > $data = array("zoo", "orange", "car", "lemon", "apple"); > usort($data, function($a, $b) { return strcmp($a, $b); }); > var_dump($data); # data is sorted alphabetically I'd LOVE it if there was SOME difference between this and a normal 'function' definition... I guess we're kind of stuck with 'create_function' being the mess that it is. But perhaps something like 'temp_function' or 'local_function' or 'lexical_closure' or something similar. Even 'horse' [*] would be fine by me. I think it muddies things too much to have it just be 'function' with no name after it. +1 * [sings] "In the desert, on a horse with no name" -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?