How to reset a PHP environment?
<p>At some point in my code, I want to undo everything that has been made and simulate a fresh start in some file.php.</p>

<p>Example: Unsetting all variables, all functions, all classes, etc.</p>

<p>Is there a way to do this?</p>

<hr>

<h2>DETAILS</h2>

<p>I have a framework that redirects all the requests to <code>index.php</code> but i want to roll some tests on it (testing the framework itself!). So i need to write a controller to access <code>/test/index.php</code> and it will start including the files and testing the functions and stuff. The thing is, I will get errors if the files are already included, the classes already exists, etc.</p>
