Troubleshooting: PHP Extended Classes
Posted on 2009-01-09 (Updated on 2019-01-24)
This is really just a quick piece of trivia, but can cause tremendous problems if you're not expecting it.
PHP does not, by default, call the parent class' constructor when you create an instance of an extended class.
If you would like to have this happen, you must add a manual call to the parent constructor, like so:
This caused some very random issues in some of my layout templates, so hopefully I've saved you the trouble of tracking them down. Enjoy!