At some point in my code, I want to undo everything that has been made and simulate a fresh start in some file.php.
Example: Unsetting all variables, all functions, all classes, etc.
Is there a way to do this?
DETAILS
I have a framework that redirects all the requests to index.php but i want to roll some tests on it (testing the framework itself!). So i need to write a controller to access /test/index.php 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.
You could just call a new page via
header( 'Location: http://domain.com/file.php' )