Re: create_function (was: Re: regex operators)
| From: | netcat | Date: | Wed, 15 Oct 2003 11:32:33 +0000 |
| Subject: | Re: create_function (was: Re: regex operators) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4859@lists.php.net to get a copy of this message | ||
Hartmut Holzgraefe wrote:
netcat wrote: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-spamhttp://php.net/create-function Thanks for the link.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