gilbertsavier
08-06-2009, 03:36 AM
Hi,
Hey there,
I have a class A that uses class B. Class B also uses class A. This is recursive and am wondering if you can redefine PHP classes like in C++.
class A{}
class B{
private $classA;
public function __construct($classA){
$this->classA = $classA;
}
public function someFunc(){ echo 'blah'; }
}
class A{
private $classB;
public function __construct($classB){
$classB->someFunc();
}
}
Hey there,
I have a class A that uses class B. Class B also uses class A. This is recursive and am wondering if you can redefine PHP classes like in C++.
class A{}
class B{
private $classA;
public function __construct($classA){
$this->classA = $classA;
}
public function someFunc(){ echo 'blah'; }
}
class A{
private $classB;
public function __construct($classB){
$classB->someFunc();
}
}