title: php variable assignment inside if conditional
body: <p>The following two <code>if</code>s produced different results(first <code>if</code> echos hi, second does not), why?  why didn't the variable assignment on <code>$t</code> work?  is this due to <code>$t</code>'s local scope inside the <code>if</code> conditional? </p>
  
  <pre><code>if(isset($_REQUEST["test"]) &amp;&amp; $t=trim($_REQUEST["test"]) &amp;&amp; !empty($t)){
     echo 'hi'
  }
  
  if(isset($_REQUEST["test"]) &amp;&amp; $t=trim($_REQUEST["test"])){
     if(!empty($t))echo 'hi'
  }
  </code></pre>