title: Calling a function before it is declared
body: <p>The following code runs in PHP</p>
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  $foo = &quot;Chocolate milkshake&quot;;
  
  go($foo);
  
  function go($param) {
      echo $param;
  }
  
  ?&gt;
  
  // Output: chocolate milkshake
  </code></pre>
  <p>See this <strong>Demo</strong> <a href="http://codepad.viper-7.com/ToApZa" rel="nofollow noreferrer">http://codepad.viper-7.com/ToApZa</a></p>
  <p>This code runs without errors and prints specified output, why?
  I thought this &quot;function hoisting&quot; only occurred in JavaScript</p>