title: require_once to global scope within a function
body: <p>It seems that if <code>require_once</code> is called within function, the included file doesn't extend the global variable scope. <strong>How to <code>require_once</code> a file to global scope from within a function?</strong></p>
  
  <p>What I'm trying to do is some dynamic module loader:</p>
  
  <pre><code>function projects_init()
  {
          ...
          foreach ($projects as $p) {
                  require_once($p['PHPFile']);
  
                  $init_func = $p['init'];
                  if ($init_func)
                          $init_func();
          }
  }
  </code></pre>
  
  <p>If it is not possible to use <code>require_once</code> that way, what is the simplest solution for this? (Please no heavy frameworks.)</p>
  
  <p>EDIT: it should also work for PHP 5.2.</p>