note 5559 deleted from language.oop by sander

From: Date: Sat, 06 Apr 2002 18:49:46 +0000
Subject: note 5559 deleted from language.oop by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-28724@lists.php.net to get a copy of this message
The comment left by darkarena@idcomm.com is incorrect. A descendant class *CAN* call the constructor of its parent. It's important to remember that the constructor is just a regular function. You can call the constructor whenever you want. class a { function a() { echo "<H2> class a constructor</H2>"; } } class b extends a { function b() { $this->a(); $this->a(); $this->a(); echo "<H2> class b constructor</H2>"; } } $object = new b();

« previous php.notes (#28724) next »