note 13625 added to keyword.parent.php
| From: | venome at gmx dot net | Date: | Mon, 25 Jun 2001 12:57:50 +0000 |
| Subject: | note 13625 added to keyword.parent.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14627@lists.php.net to get a copy of this message | ||
If you have a complex class hierarchy, I find that it's a good idea to have a function
constructor() in every class, and the 'real' php constructor only exists in the absolute
base class.
From the basic constructor, you call $this->constructor(). Now descendants simply have to call
parent::constructor() in their own constructor, which eliminates complicated parent calls.
http://www.php.net/manual/en/keyword.parent.php