Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4859 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1921 invoked by uid 1010); 15 Oct 2003 11:28:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1879 invoked from network); 15 Oct 2003 11:28:30 -0000 Received: from unknown (HELO mail.sites-secure.com) (213.189.34.71) by pb1.pair.com with SMTP; 15 Oct 2003 11:28:30 -0000 Received: by mail.sites-secure.com (CommuniGate Pro PIPE 3.5.9) with PIPE id 31397855; Wed, 15 Oct 2003 13:25:03 +0200 Received: from [192.117.106.24] (account ilya@up.co.il HELO abox.co.il) by mail.sites-secure.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 31397858; Wed, 15 Oct 2003 13:24:58 +0200 Message-ID: <3F8D3051.5060600@abox.co.il> Date: Wed, 15 Oct 2003 13:32:33 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3; MultiZilla v1.3.1 (a)) Gecko/20031008 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: hartmut@php-groupies.de CC: internals@lists.php.net References: <3F8C1063.7040907@php.net> <3F8C3F72.1060100@abox.co.il> <3F8D0180.7030602@php.net> In-Reply-To: <3F8D0180.7030602@php.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DoalSignature: rot-4 (smtp) Subject: Re: create_function (was: Re: regex operators) From: netcat@abox.co.il (netcat) Hartmut Holzgraefe wrote: > netcat wrote: > >>> i've started to play with a more general way to handle this: >>> >>> switch(mixed data [, callback compare_function]) >> >> >> >> seems the sanest thing up until now. >> >> slighly O.T.: would be and even better if lambda functions were >> available here > > > > http://php.net/create-function > Thanks for the link. It's just feels a little awkward to see something like: switch($x,create_function('$a,$b','return $a=="MY$b;"')) { } Again, it's a feeling, maybe it's just me. It doesn't feel right to me that inside definition of new function i have to escape quotes (that's because create_function is a function and not special construction on the other side if it would be a construct it can't return a value as in $x=create_function(...) ). Anyway, i have nothing better to suggest (yet) .... I hope one of you have some suggestion that will make create_function more usable. -- NetCat ------------------------------------------------------ SPAM-Free 10mb Free email + Antivirus + POP3 + more... Get it at http://www.doal.co.il:81/free/?c=all-spam