title: How to parse a string of boolean logic in PHP
body: <p>I'm building a PHP class with a private member function that returns a string value such as:</p>
  
  <pre><code>'true &amp;&amp; true || false'
  </code></pre>
  
  <p>to a public member function.  (This string is the result of some regex matching and property lookups.)  What I'd like to do is have PHP parse the returned logic and have the aforementioned public function return whether the boolean result of the parsed logic is true or false.</p>
  
  <p>I tried eval(), but I get no output at all.  I tried typecasting the boolean returns...but there's no way to typecast operators...hehe  Any ideas?  (Let me know if you need more information.)</p>