note 16763 deleted from keyword.extends by jimw
| From: | jimw@php.net | Date: | Fri, 16 Nov 2001 00:38:34 +0000 |
| Subject: | note 16763 deleted from keyword.extends by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20901@lists.php.net to get a copy of this message | ||
I am revising the code from my previous posting. This *tested* code demonstrates the limitation of
calling a the parent class's constructor:
class a {
function a() {
$this->init();
}
function init() {
echo 'hello from a -- ';
}
};
class b extends a {
function b() {
parent::a();
$this->init();
}
function init() {
echo 'hello from b -- ';
}
};
$bb = new b();
--results in
hello from b! -- hello from b!
instead of the expected:
hello from a! -- hello from b!