Possible Duplicate:
Undeclare a class in PHP
There are class A in A.php
, and B in B.php
. I create a new instance of B in one of functions of A. In that function I change the B.php file and it's structure, I want to use the new B.php in continue lines of A.php.
If I call require 'B.php'
it says Fatal error: Cannot redeclare class B
Is there any way to remove 'class' B from memory and require it again?
I'm using an ORM named Doctrine I have a form builder that generates Files for Entities so When the form submits I have to change an Entity's file and require it again and also use the new object! This is my actual problem
Or Is there any way to include a file as another name like python? in python we say import sys as MyName