title: PHP shorthand logical operators AND and OR
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/4502092/php-and-or-keywords">PHP - and / or keywords</a><br>
    <a href="https://stackoverflow.com/questions/2475047/php-shorthand-syntax">PHP shorthand syntax</a>  </p>
  </blockquote>
  
  
  
  <p>Quick question. I keep seeing shorthand expressions in libraries around the place, and despite having been a PHP developer for over 3 years, I struggle to quite see how the following would evaluate.</p>
  
  <p>What exactly does the PHP interpreter do with the following shorthand lines of code when it encounters them?</p>
  
  <pre><code>&lt;?php
      defined('foo') OR exit('foo is not defined!');
  
      $foo AND $this-&gt;bar();
  </code></pre>
  
  <p>I'm guessing that it' obviously conditional execution - i.e. the second statement won't get executed unless the first bit is true... but the use of the bitwise operators confuse me a bit.</p>
  
  <p>Can someone elaborate?</p>
  
  <p>Thanks :)</p>