I was wondering why should we explicitly call the parent constructor in PHP? What happens if, for example, we forget to call the parent constructor in a derived class?
I thought that the derived class would not have access to the properties or method of its parent class, but after I try not to call the parent constructor, it seems that the child class still gets access to its parent public / protected member.
So, should we explicitly call its parent constructor? What are the consequences if we forget to do this?
Thanks in advance. Any kind of help would be appreciated :)
source
share