Destroying a class
Posted: Wed May 10, 2006 11:26 am
Hi! I have a problem and I don't know how to resolve it.
I have 2 files:
a.php
b.php
In both of them, I have a class called myClass()
I wanted to do something like this:
require_once(a.php)
$x=new myClass()
unset($x)
require_once(b.php)
$x=new myClass()
unset($x)
I thougt that this would work, but there is an error:
Cannot redeclare class myClass
Why? I have done an unset(). Is there any way to do what I want?
What's the problem? I'm becoming crazy.
Thank you very much!
I have 2 files:
a.php
b.php
In both of them, I have a class called myClass()
I wanted to do something like this:
require_once(a.php)
$x=new myClass()
unset($x)
require_once(b.php)
$x=new myClass()
unset($x)
I thougt that this would work, but there is an error:
Cannot redeclare class myClass
Why? I have done an unset(). Is there any way to do what I want?
What's the problem? I'm becoming crazy.
Thank you very much!