Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28442 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92694 invoked by uid 1010); 19 Mar 2007 20:35:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92658 invoked from network); 19 Mar 2007 20:35:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 20:35:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Linux 2.5 (sometimes 2.4) (4) Received: from [66.11.173.122] ([66.11.173.122:45248] helo=blobule.interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/20-01604-004FEF54 for ; Mon, 19 Mar 2007 15:35:12 -0500 Received: by blobule.interjinn.com (Postfix, from userid 2000) id 425865AD3D1; Mon, 19 Mar 2007 16:35:18 -0400 (EDT) To: ceo@l-i-e.com Cc: Wez Furlong , internals@lists.php.net In-Reply-To: <54922.216.230.84.67.1174335655.squirrel@www.l-i-e.com> References: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> <54922.216.230.84.67.1174335655.squirrel@www.l-i-e.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: InterJinn Date: Mon, 19 Mar 2007 16:35:17 -0400 Message-ID: <1174336517.24632.111.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Subject: Re: [PHP-DEV] PATCH: anonymous functions in PHP From: robert@interjinn.com (Robert Cummings) On Mon, 2007-03-19 at 15:20 -0500, Richard Lynch wrote: > 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 A function with a name is no longer anonymous ;) Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'