PDA

View Full Version : Redefining PHP Classes



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();
}
}

nasreen222
09-01-2009, 12:23 AM
Not sure, but if you code.gif, it'll make it easier for everyone else to read.
__________________________
reverse mortgages (http://www.ascotmortgage.com:)
cloud computing (http://www.silvermako.com)