title: Javascript-like || in php
body: <p>In <code>javascript</code>, I can use, for example such statement: </p>
  
  <pre><code>window.foo = window.foo || [];
  </code></pre>
  
  <p>If there's no <code>window.foo</code> it will be assigned to array, but won't be converted into <code>boolean</code>.</p>
  
  <p>But if I will do such thing in <code>php</code>, I will get either <code>true</code> or <code>false</code>. (ig. <code>boolean</code> result, not variable equal to <code>true</code> value)</p>
  
  <p>Why such difference exists?</p>
  
  <p><strong>PS</strong> the question is not about what to use instead, the question is about why it is.</p>