note 11003 deleted from language.oop by victor
| From: | victor@php.net | Date: | Sat, 07 Dec 2002 15:45:16 +0000 |
| Subject: | note 11003 deleted from language.oop by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40478@lists.php.net to get a copy of this message | ||
I just went through all sorts of playing around with the PHP object inheritance, and the following
is the best way to call an overloaded parent function as far as I can tell:
class a {
function init() {
echo "A init<br>";
}
}
class b extends a {
function init() {
a::init();
echo "B init<br>";
}
}
$x = new b;
$x->init();
This will output:
A init
B init
by calling the init() function of a within the init() function of b through the use of a::init() and
it seems to work just fine.