Page 1 of 1

Extends Construct?

Posted: Tue Jun 17, 2008 2:43 pm
by infolock
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 :)

Re: Extends Construct?

Posted: Tue Jun 17, 2008 2:46 pm
by WebbieDave
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."

Re: Extends Construct?

Posted: Tue Jun 17, 2008 3:00 pm
by infolock
what i was looking for. thanks :)