How can I force the execution of a PHP file in a global scope?
<p>I have a php file, say include.php which has the following contents:</p>

<pre><code>&lt;?php
$myVar = "foo";
?&gt;
</code></pre>

<p>Now, I want to create a class, called GlobalInclude, which can include a file in the global scope:</p>

<pre><code>class GlobalInclude {
    public function include( $file="include.php" ) {
        #do something smart
        include $file
        #do something smart
    }
}
</code></pre>

<p>In it's current form, the $myVar variable will only be available inside the scope of the include function. I want to do something like:</p>

<pre><code>GlobalInclude::include( "include.php" );
echo $myVar;
</code></pre>

<p>Output
foo</p>

<p>Any ideas on how I can accomplish this?</p>
