title: Variable scope in a required file
body: <p>I'm calling a file named ajax.php (from my browser for testing)</p>
  
  <p>ajax.php require_once delete.php</p>
  
  <p>delete.php require_once no_direct.php</p>
  
  <p>delete.php starts like this:</p>
  
  <pre><code>$allowed = array('group'=&gt;'admin');
  require_once(ASSETS.'/no_direct.php'); //Yes, ASSETS is defined and no_direct is being included.
  </code></pre>
  
  <p>In no_direct.php I'm trying to:</p>
  
  <pre><code>var_dump($allowed)
  </code></pre>
  
  <p>and I just keep coming up NULL.</p>
  
  <p>Does this happen because we are running inside ajax.php's require_once function and the scope of $allowed pushes back to the GLOBAL scope not allowing me to access it from no_delete.php?</p>
  
  <p>I was looking here: <a href="https://stackoverflow.com/questions/3954049/php-variable-defined-in-parent-file-not-recognized-in-required-file">PHP variable defined in &#39;parent&#39; file not recognized in &#39;required&#39; file</a> , just to be diligent.</p>
  
  <p>I'm sure I could solve this with the GLOBAL keyword, but I was hoping for a little clarification.  The PHP scope doc didn't seem to answer the question for me.</p>
  
  <p>It wasn't wrapped in another function as thought to be the case.</p>