Jump to content

Redefining Php Classes


Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...