PHP 4.0 Bug #8965: Superclass constructor not invoked when subclass also contains a constructor
| From: | jeff at iomojo dot com | Date: | Sun, 28 Jan 2001 11:25:03 +0000 |
| Subject: | PHP 4.0 Bug #8965: Superclass constructor not invoked when subclass also contains a constructor | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45259@lists.php.net to get a copy of this message | ||
From: jeff@iomojo.com
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