title: Variable scope difference between PHP and C: block scope is not exactly the same?
body: <p>The following PHP code will output <code>3</code>.</p>
  
  <pre><code>function main() {
      if (1) {
          $i = 3;
      }
      echo $i;
  }
  
  main();
  </code></pre>
  
  <p>But the following C code will raise a compile error.</p>
  
  <pre><code>void main() {
      if (1) {
          int i = 3;
      }
  
      printf("%d", i);
  }
  </code></pre>
  
  <p>So variables in PHP are not strictly block-scoped? In PHP, variables defined in inner block can be used in outer block?</p>