Answer the question
In order to leave comments, you need to log in
PHP. OOP. How to implement combination, association and inheritance between classes?
I understand the implementation of relations between classes, please tell me with an example how to implement relations according to this scheme
. If it’s not difficult, please write the code for clarity, here are my attempts to implement a combination between class A and B:
class A
{
function __construct()
{
}
}
class B
{
public $objectA;
function __construct()
{
$this->objectA = new A();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question