Calling parent's constructor in PHP Calling parent's constructor in PHP php php

Calling parent's constructor in PHP


Just call it using parent::

    /* Settings */class Settings{ function __CONSTRUCT(){  echo "Settings Construct"; }}/* PageManager */class PageManager extends Settings{ function __CONSTRUCT(){    parent::__CONSTRUCT();    echo "PageManager Construct"; }}

Have a look at the manual(Constructors and Destructors)!


In addition: you should know that this behaviour of PHP is not unique to the __construct() function.