Is there a way to set the scope of require_once() explicitly to global?
<p>I'm looking for a way to set the scope of <code>require_once()</code> to the global scope, when <code>require_once()</code> is used inside a function. Something like the following code should work:</p>

<p>file `foo.php':</p>

<pre><code>&lt;?php

$foo = 42;
</code></pre>

<p>actual code:</p>

<pre><code>&lt;?php

function includeFooFile() {
    require_once("foo.php"); // scope of "foo.php" will be the function scope
}

$foo = 23;

includeFooFile();
echo($foo."\n"); // will print 23, but I want it to print 42.
</code></pre>

<p>Is there a way to explicitly set the scope of <code>require_once()</code>? Is there a nice workaround?</p>
