Run php variables as it was an if statement
<p>I've got 3 variables:</p>

<pre><code>$left_side = "'Username'";
$equation = "==";
$right_side = "'Username'";
</code></pre>

<p>I want to test these variables as it was an if statement like so:</p>

<pre><code>if($left_side $equation $right_side) {
    // do something
} else {
    // do something else
}
</code></pre>

<p>I know this works:</p>

<pre><code>if(eval("return ".$left_side." ".$equation." ".$right_side.";")) {
    // do something
} else {
    // do something else
}
</code></pre>

<p>I always tought it's 'not good' to use eval. Especially when you try to run user input. </p>

<p>Is there an other way to do this? I tried to google it, but it's not my friend to day ;)</p>
