Re: Constructor Inheritance

From: Date: Mon, 21 May 2001 15:46:00 +0000
Subject: Re: Constructor Inheritance
References: 1  Groups: php.dev php.general 
Request: Send a blank email to php-dev+get-56067@lists.php.net to get a copy of this message
Hello Tiago, this is not the PHP support forum. PHP-DEV is for developing PHP. You want to post such questions to PHP-GENERAL. On Mon, May 21, 2001 at 04:17:49PM +0100, Tiago Moitinho wrote : > How do I inherit a class that inherits the constructor behaviour from the > parent class, assuming the parent class cannot be changed? > For instance, > > class A { > // this class is already define, not changeable > function A() > // does something > } > } > > class B extends A { > function B() > // inherits A construction: how do I do this? > // does something else > } > } class B extends A { function B() { // call parents constructor A::A(); } } - Markus

« previous php.dev (#56067) next »