title: what is the most efficent way to write if else in php?
body: <p>hi i am building a large application using <code>codeigniter</code> . because the application is very large , performance is a must .  i want to optimize my if else statements . </p>
  
  <p>is there is difference of performance using 
  from</p>
  
  <pre><code>if(false)   and    if(0)
  
  if(true)   and    if(1)
  </code></pre>
  
  <p>what is the efficient way ?</p>
  
  <p>and when using logical operators is their any sequence that optimize the performance </p>
  
  <p>from  <code>if((a &amp; b) || c)</code>   and  <code>if(c || (a &amp; b) )</code> </p>
  
  <p>what is the efficient way ? or those two are the same ?</p>
  
  <p>and from</p>
  
  <p><code>if(a &amp;&amp; b)</code>  and <code>if(a &amp; b)</code></p>
  
  <p>what is the efficient way ? </p>
  
  <p>and from</p>
  
  <pre><code>if(a || b) and  if(a | b)
  </code></pre>
  
  <p>what is the efficient way ? </p>
  
  <p>is there any performance difference between  <code>if(a || b) and  if((a || b))</code>
  note that 2 nd if is in two additional parentheses </p>
  
  <p>please help me ................................... 
  thanks in advance.</p>