On Sun, 22 Aug 2004 13:04:11 +0200, Daniel Schierbeck <[EMAIL PROTECTED]> wrote: > Hello there. I was experimenting a bit with the constructors and > destructors, and found that this code: > > <?php > > class First > { > public function __construct () > { > echo "Hello, World!\n"; > } > > public function __destruct () > { > echo "Goodbye, World!\n"; > } > } > > class Second extends First > { > > } > > $second = new Second; > > ?> > > Outputs > > Hello, World! > Goodbye, World! > > , yet the PHP manual > (http://www.php.net/manual/en/language.oop5.decon.php) says: > > Note: Parent constructors are not called implicitly. In order > to run a parent constructor, a call to parent::__construct() is > required. > > Is this an error in the manual or in PHP itself? Should I report it > somewhere? >
No, this is not a bug. This means that if you define a new constructor / destructor, the parent class's won't be called unless you put it in the new ones. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php