If you extend a class, does this call the __construct() of the class you are extending to? Thanks
Extends Construct?
Moderator: General Moderators
Extends Construct?
I am pretty sure I could write a quick test to see if this happens or not, but figured i would just ask since I had about 18 other things going on at once hah.
If you extend a class, does this call the __construct() of the class you are extending to? Thanks
If you extend a class, does this call the __construct() of the class you are extending to? Thanks
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: Extends Construct?
from: http://us.php.net/manual/en/language.oop5.decon.php
"Parent constructors are not called implicitly if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required."
"Parent constructors are not called implicitly if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required."
Re: Extends Construct?
what i was looking for. thanks 