Got a question that is freaking me out. Do parent constructors constructs itself without being called?
Cause Im seeing it working on a situation and not on the script Im writing.
I got the following:
boot.php
$this->router = new router($param);
router.php
class router extends routerController
routercontroller.php
class routerController{
function __construct($param){
$this->param = $param;
}
On the same script I got inside the routerController class.
$this->newclass = newclass($this->param);
newClass extends someClass. For some reason the someClass constructor is not instantiated if I don't call it from the newClass using parent::__construct($param).
I already spent hours reviewing all the code and can't find what Im doing wrong. Why in the first case the parent constructor is instantiated without being called and on the second case not?
Is this a bug? Any idea what I am doing wrong?
In PHP parent constructors aren't called implicitly.