gilbertsavier Posted August 7, 2009 Share Posted August 7, 2009 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(); }} Link to comment Share on other sites More sharing options...
justsomeguy Posted August 7, 2009 Share Posted August 7, 2009 I don't think you can redefine a class, but you can still use inheritance to base a new class off an existing class. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.