CodeIgniter Forums
What's the difference between parent::__construct(); vs. parent::Controller(); - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: What's the difference between parent::__construct(); vs. parent::Controller(); (/showthread.php?tid=23032)



What's the difference between parent::__construct(); vs. parent::Controller(); - El Forum - 09-28-2009

[eluser]rvillalon[/eluser]
What's the difference between parent::__construct(); vs. parent::Controller();?

It seems like it does the same thing.


What's the difference between parent::__construct(); vs. parent::Controller(); - El Forum - 09-28-2009

[eluser]pistolPete[/eluser]
The difference between those lines is the PHP version you are using:
Code:
// PHP4  (and PHP5)
parent::Controller();

// PHP 5 only
parent::__construct();

http://php.net/manual/en/language.oop5.decon.php


What's the difference between parent::__construct(); vs. parent::Controller(); - El Forum - 09-29-2009

[eluser]rvillalon[/eluser]
Thanks pistolpete!