i'm putting together a function currently like this (it's inside a for-loop):
PHP Code:
// standard comparison operators
if (preg_match('/^((==|<|>|!=)=?|<>)$/'$mode) == 1) {
$cmp create_function('$a, $b'"return \$a $mode \$b;");
    if (!

this is my concise way of running a comparison of 2 values from operators passed in from a config file as a string, eg '==' or '<='.

i dont think there is an alternative in 5.3 to using this construction; lambdas would not really solve this. you'd still need to create a 9-case switch for all operators.

if anyone knows otherwise, let me know.