I'm trying to make sense of this code in this busted PHP application at work. Just to give you an idea, this function is usually called compare("foo", "==bar") . The quotes around the if blocks, the lack of a logic operator, the dereferencing of $res, the random eval(), I don't get it.Code:function compare($var1,$var2)
{
$string = "if($var1 $var2)
{
\$res=1;
}
else
{
\$res=0;
}";
eval("$string;");
return $res;
}
