Re: parent constructor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jasper Bryant-Greene wrote:
SLaVKa wrote:

Hey guys just a general question... if you have a parent::__constructor() call in your constructor function, should that call ideally be placed before or after the code inside the current constructor? or it doesnt really matter


That depends on which code you want to run first. Seriously.

true in practice but in theory the parent ctor should be called
first before anything else is done - the theory is that the
'base of the object' should be completely setup before you construct
stuff in the current level (which may rely on stuff that is configured/setup
in the parent ctor).

so, what Jasper said, basically.

NB: it's parent::__construct() not parent::__constructor()


Jasper


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux