Is there a nicer way to write this (preferably without eval!)?
function something($value, $operator) {
switch ($operator) {
case '=':
return $this->arg == $value;
case '<':
return $this->arg < $value;
case '>':
return $this->arg > $value;
// etc.
}
}
It's basicaly $operator($this->arg, $value)
except you can't do that in PHP.