title: Variables in if condition scope
body: <p>There's not much about this argument on this community so I thought to drop this question.</p>
  
  <p>I have this piece of code used for validating <code>$params['full_name']</code>:</p>
  
  <pre><code>$params = ["full_name"=&gt;"John Doe"];
  $full_name = $flag ? null : ( ( $tmp_name = trim(strip_tags((string)@$params['full_name']))
                              &amp;&amp;  (strlen($tmp_name) &gt; 3 &amp;&amp; strlen($tmp_name) &lt; 30)
              ) ? $tmp_name : out('The full name must be 3-30 characters', 'Invalid full name'));
  </code></pre>
  
  <p>Despite of <code>$params['full_name"]</code> being populated correctly, I get a run-time error:</p>
  
  <pre><code>&lt;b&gt;Notice&lt;/b&gt;: Undefined variable: tmp_name
  </code></pre>
  
  <p>Why is this happening? Am I just missing the theory of scoping inside <code>if</code> statements?</p>