RE: [PHP] Question regarding OOP and interitance

From: Date: Thu, 04 Sep 2003 13:30:04 +0000
Subject: RE: [PHP] Question regarding OOP and interitance
Groups: php.general 
Request: Send a blank email to php-general+get-161647@lists.php.net to get a copy of this message
[snip] I would like to know a constructor function is also inherited to a child class. I mean the child class also needs to have a constructor function but it must have the same name as the class name. How does that work? [/snip] FYI ... anything below PHP5 has a pseudo constructor. Since you are inheriting the class the 'constructor' for the parent class should work. If it doesn't (I have not tested it, and neither have you)then the class extension can contain a 'contstructor' that is a duplicate of the parent class 'constructor' but with the extension name. You'll have to test it to make sure.

« previous php.general (#161647) next »