PDA

View Full Version : Redefining PHP Classes



gilbertsavier
14 Jul 2009, 12:51 AM
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();
}
}

--------------------------------------
Thanks & regards
Lokananth
Live chat (http://www.mioot.com) By miOOt