Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43244 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84005 invoked from network); 4 Mar 2009 12:40:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2009 12:40:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.220.158 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.220.158 mail-fx0-f158.google.com Received: from [209.85.220.158] ([209.85.220.158:60161] helo=mail-fx0-f158.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/02-07946-7A67EA94 for ; Wed, 04 Mar 2009 07:40:08 -0500 Received: by fxm2 with SMTP id 2so2939339fxm.23 for ; Wed, 04 Mar 2009 04:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+9tDvWubvYCLvnsahTlurRSYJGKn3p/DBcczWWck7kw=; b=gBtUnsWW3UnlAT6dtaAihmUDD2LBVx82pgWM1vaVAG1NfUs5Y1J6ouT6a6Xg2HFUXn k960WlFG1GqUlI+8oI+bOVcpx9OYRvoDHw5xsDGbQ1cyGqYQ3RqAo03nVxaxGR+41hXj KcPogmePCYLGkCwLDYQG7qRcpffWUnWzeqF/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=W++rZEXPCQ7cAPJrECzFC9+7x5qlnALfIf6izHqEPuS7Kn5Tj9aHWQusTBa3lcik6T OyCmZU1+awWPMTx9PZnwCr+fALQAcZ59qNJRuw7xtRhfX0Cvq5BgTWZM9a/XQ6YxEMEi +WJdVdP77Ovh1JiORZfspNumEVVsVQcx9EpNQ= MIME-Version: 1.0 Received: by 10.223.109.20 with SMTP id h20mr1867087fap.41.1236170405164; Wed, 04 Mar 2009 04:40:05 -0800 (PST) Reply-To: RQuadling@googlemail.com In-Reply-To: <49AE7125.7000108@daevel.net> References: <10845a340903040333g5fd001fdw73fc17eacbd968c9@mail.gmail.com> <49AE7125.7000108@daevel.net> Date: Wed, 4 Mar 2009 12:40:05 +0000 Message-ID: <10845a340903040440l12bb4584uc29c4c95ec6537e8@mail.gmail.com> To: "Olivier B." Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Are there plans to allow anonymous functions as callbacks? From: rquadling@googlemail.com (Richard Quadling) 2009/3/4 Olivier B. : > > Alexey Zakhlestin a =C3=A9crit : >> >> On Wed, Mar 4, 2009 at 2:33 PM, Richard Quadling >> wrote: >> >>> >>> Hi. >>> >>> Quite a simple question (assuming I've got the terminology correct). >>> >>> Are there any plans to allow code like this (amended example taken >>> from the array_map() documentation) ... >>> >>> >> $a =3D array(1, 2, 3, 4, 5); >>> $b =3D array_map(function($n){return($n * $n * $n)}, $a); >>> print_r($b); >>> >>> For me, this is cleaner than having a use-once, namespace-polluting >>> function. >>> >>> Currently, this is producing a parse error. >>> >> >> It works. You have a typo. You need to put ";" after return (=E2=80=A6) >> Just shoot me now! >> > > Hi, > > with PHP < 5.3, you can also use create_function() > (http://www.php.net/create_function ) > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474= 731 "Standing on the shoulders of some very clever giants!"