title: When should I use a bitwise operator?
body: <p>I read the following Stack Overflow questions, and I understand the differences between bitwise and logical.</p>
  
  <ul>
  <li><p><em><a href="https://stackoverflow.com/questions/2376348/difference-between-and-in-php">Difference between &amp; and &amp;&amp; in PHP</a></em></p></li>
  <li><p><em><a href="https://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php">Reference - What does this symbol mean in PHP?</a></em></p></li>
  </ul>
  
  <p>However, none of them explains when I should use bitwise or logical.</p>
  
  <p>When should I use bitwise operators rather than logical ones and vice versa?</p>
  
  <p>In which situation do I need to compare bit by bit?</p>
  
  <p>I am not asking about the differences, but I am asking the situation when you need to use bitwise operators.</p>