[PHP-DEV] PHP 4.0 Bug #8965: Superclass constructor not invoked when subclass also contains a constructor From: jeff <email protected>
Date: 01/28/01

From: jeff <email protected>
Operating system: RedHat 7.0
PHP version: 4.0.4pl1
PHP Bug Type: Class/Object related
Bug description: Superclass constructor not invoked when subclass also contains a constructor

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'

-- 
Edit Bug report at: http://bugs.php.net/?id=8965&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>