PHP includes/require in a file and all functions inside it
<p>I have a file which I include say:</p>

<pre><code>    require_once("../../constructor/database.php");

$stuff_inside_include_file-&gt;doThis() ; //ACCESSIBLE

function createUser(){
   $stuff_inside_include_file-&gt;doThat(); //NOT-ACCESSIBLE (object not found)
} 

function deleteUser(){
. ...
</code></pre>

<p>If I move the require statement into the scope of the function, then it works. Otherwise, it doesn't. Is there a better solution?</p>

<p>Thank you in advance.</p>
