Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28469 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76961 invoked by uid 1010); 19 Mar 2007 22:48:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76946 invoked from network); 19 Mar 2007 22:48:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 22:48:04 -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:2236] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/F8-01604-2231FF54 for ; Mon, 19 Mar 2007 17:48:03 -0500 Received: (qmail 37603 invoked by uid 98); 19 Mar 2007 22:48:03 -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.112824 secs); 19 Mar 2007 22:48:03 -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.112824 secs) Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 22:48:03 -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 17:48:03 -0500 (CDT) Message-ID: <50400.216.230.84.67.1174344483.squirrel@www.l-i-e.com> In-Reply-To: <45FF0FBB.8040100@zend.com> References: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> <45FDF031.4010508@zend.com> <45FE2312.1050506@zend.com> <45FED6D9.8030307@caedmon.net> <45FEDAE5.2010309@zend.com> <45FEE396.7040905@caedmon.net> <0757BDEA-65F5-4123-B647-060DCA84B4B0@omniti.com> <32945.216.230.84.67.1174340098.squirrel@www.l-i-e.com> <45FF06B4.2060801@zend.com> <41955.216.230.84.67.1174343185.squirrel@www.l-i-e.com> <45FF0FBB.8040100@zend.com> Date: Mon, 19 Mar 2007 17:48:03 -0500 (CDT) To: "Stanislav Malyshev" Cc: "Wez Furlong" , "Sean Coates" , 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 Mon, March 19, 2007 5:33 pm, Stanislav Malyshev wrote: >> Can't you just take the body of "create_function" with the syntax of >> the patch, and marry those two? > > Well, that'd be a bit hard since the whole difference is that > create_function is runtime (thus having access to run-time values) > while > anon-func we are trying to do here is compile-time (at least it makes > a > lot of sense to do it compile-time). We could of course just leave the > scope thing alone and say "want access to other scope? tough luck, use > create_function/eval or globals". I thought the original driving purpose was to not have the gnarly quoting mess of create_function. Yes, in the implementation, it turned out to be a compile-time closure. Does that mean we really WANT to go there, just because it falls out easily, or does that mean we should step back and look at the original goal and see if maybe we've gone off-track? >> How does the current create_function handle this same scope issue? > > It doesn't AFAIK :) Since it's a close relative of eval, it can import > values of variables by inserting ones into function string, but > nothing > more (i.e. you couldn't put an object there, and couldn't refer to a > variable - only insert it's value). I'd be perfectly happy if PHP's "anonymous" functions had the nice syntax and no funky weird stuff about closure, a la eval/create_function, personally. I don't need the closures, but when I need a quickie anon function in PHP, I just want something less ugly than create_function. That's just my personal preference, of course. -- 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?