title: Dynamic Comparison Operators in PHP
body: <p>Is it possible, in any way, to pass comparison operators as variables to a function? I am looking at producing some convenience functions, for example (and I know this won't work):</p>
  
  <pre><code>function isAnd($var, $value, $operator = '==')
  {
      if(isset($var) &amp;&amp; $var $operator $value)
          return true;
  }
  
  if(isAnd(1, 1, '===')) echo 'worked';
  </code></pre>
  
  <p>Thanks in advance.</p>