Question with setting variables in if statements
<p>Here is the sample:</p>

<pre><code>if(($test = array('key'=&gt;true)) &amp;&amp; $test['key']){
    // works
}
if($test = array('key'=&gt;true) &amp;&amp; $test['key']){
    // does not work
}
</code></pre>

<p>Why is the parenthesis required? My understanding is that it computes the first conditional then the second no matter what.</p>

<p>And is it "safe" to do an assignment like this? </p>
