Why 0 || 1 returns true in php?
<p>In Javascript and Python, <code>0 || 1</code> returns <code>1</code>.</p>

<p>But in PHP, <code>0 || 1</code> returns true.</p>

<p>How to do if I want <code>0 || 1</code> return <code>1</code> in PHP?</p>

<p>another example,</p>

<p><code>$a</code> is <code>array(array('test'))</code></p>

<p>I want <code>$a['test'] || $a[0] || array()</code> return <code>array('test')</code>, How to do?</p>
