Is there some trick to override a class dynamically in PHP?
- by user198729
I have two class named test in two different files,a.php and b.php for instance,the logic is like this:
include('a.php');
$a = new test();
if($somcondition_is_met)
{
include('b.php');
$b = new test();
}
Is there some trick to avoid Fatal error: Cannot redeclare class ?