Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18272 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90917 invoked by uid 1010); 22 Aug 2005 19:53:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 90902 invoked from network); 22 Aug 2005 19:53:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Aug 2005 19:53:24 -0000 X-Host-Fingerprint: 66.80.117.3 longsword.omniti.com Linux 2.5 (sometimes 2.4) (4) Received: from ([66.80.117.3:55750] helo=mail.omniti.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 5A/F2-33075-33D2A034 for ; Mon, 22 Aug 2005 15:53:23 -0400 Authentication-Results: mail.omniti.com smtp.user=george; auth=pass (LOGIN) DomainKey-Status: good X-DomainKeys: Ecelerity dk_sign implementing draft-delany-domainkeys-base-01 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=test; d=omniti.com; h=Received:In-Reply-To:References:Mime-Version:Content-Type:Message-Id:Cc:From:Subject:Date:To:X-Mailer; b=h5Mi6vUhgPAViYjU+NwFNy/T9qCDKLFmeoL4LB4PtiUrisgNBjuJJ65VfkPxwePz XnNgMuKptpag9jZ+mVpUraYJKQ2m4vA8e014GHS4lgMoZvjuMiBZbWcY6uoJuUS8 Received: from ([66.80.117.2:51694] helo=[10.80.116.150]) by mail.omniti.com (ecelerity HEAD r(6464/6465M)) with SMTP id B3/91-08424-22D2A034 for ; Mon, 22 Aug 2005 15:53:12 -0400 In-Reply-To: References: <42FCE0E4.604@lerdorf.com> <4309DC9B.8020904@peda.net> <19310545471.20050822200017@marcus-boerger.de> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: multipart/alternative; boundary=Apple-Mail-3-404294586 Message-ID: Cc: George Schlossnagle , Marcus Boerger , internals@lists.php.net Date: Mon, 22 Aug 2005 15:53:02 -0400 To: Stanislav Malyshev X-Mailer: Apple Mail (2.733) Subject: Re: [PHP-DEV] Re: PHP 6.0 Wishlist From: george@omniti.com (George Schlossnagle) --Apple-Mail-3-404294586 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Aug 22, 2005, at 2:08 PM, Stanislav Malyshev wrote: > MB>>> * Anonymous functions. The real stuff, not just some odd string > MB>>> passed to create_function(). > MB>> > MB>>There were some others already asking for this, maybe we should > at least > MB>>give it a thought if it is doable at all, anybody? > > Just out of curiosity, what's bad in create_function and how "real" > ones > should be different? Two major differences as I see it: 1) syntactical: the amount of escaping/funkyjunk you need to do to have anonymous functions look like regular functions in their declaration is huge (yes, you can use heredocs, but they have their (big if you run up against them) limitations as well). 2) no garbage collection on them (so in something like perl, when you anonymous sub goes out of scope, it's cleaned up). 3) runtime vs. compiletime definition For me 3 is good the way it is (the whole point of anon. functions (for me) is to allow me to easily vary their definition at runtime). 2 I can see being a pain, but I don't consider it critical. 1 keeps me from using create_function - the required code is to obtuse to use in most cases - I really would like to be able to do: $max = function ($a, $b) { return $a < $b?$b:$a; } (for why heredocs suck here, consider the case where I want to use constants in the definition). George > -- > Stanislav Malyshev, Zend Products Engineer > stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > George Schlossnagle -- Vice President of Engineering -- OmniTI Computer Consulting -- http://www.omniti.com --Apple-Mail-3-404294586--