PHP 4.0 Bug #8965 Updated: Superclass constructor not invoked when subclass also contains a constructor

From: Date: Thu, 22 Feb 2001 15:50:03 +0000
Subject: PHP 4.0 Bug #8965 Updated: Superclass constructor not invoked when subclass also contains a constructor
Groups: php.dev 
Request: Send a blank email to php-dev+get-47255@lists.php.net to get a copy of this message
ID: 8965 Updated by: stas Reported By: jeff@iomojo.com Old-Status: Open Status: Closed Bug Type: Class/Object related Assigned To: Comments: This is by design. Previous Comments: --------------------------------------------------------------------------- [2001-01-28 06:25:03] jeff@iomojo.com If we have 2 classes: class A { ... // constructor function A() { // do things } ... } class B extends A { ... // constructor function B() { // do things } ... } When a B object is first created, its constructor is called but the constructor for class A is not. For things to work as expected, the constructor for class A must be called as with class C below. class C extends A { ... // constructor function C() { // do things // Manually exec the constructor for class A $this->A(); } ... } Not that it should matter, but my configure command is below: './configure' '--with-apxs=/usr/sbin/apxs' '--enable-track-vars' '--enable-magic-quotes' '--enable-sigchild' '--enable-calendar' '--enable-ftp' '--with-gd=shared' '--with-mysql=/usr/local' '--with-pdflib=shared' '--enable-wddx' '--enable-sysvmem' '--enable-sysvshm' '--with-xml' '--with-zlib' '--with-ttf' '--enable-sockets' --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=8965&edit=2

« previous php.dev (#47255) next »