PHP global variable not found in functions
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5492931/global-variables-in-php">Global variables in PHP</a>  </p>
</blockquote>



<p>I have a PHP script someting like</p>

<pre><code>global $var1;

function func1() {
    $var1-&gt;something(); // $var1 not found ... why?
}
</code></pre>

<p>must I do global $var1 in every function?</p>
