note 23428 added to keyword.extends
| From: | griffon9 at hotmail dot com | Date: | Thu, 18 Jul 2002 08:42:37 +0000 |
| Subject: | note 23428 added to keyword.extends | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33240@lists.php.net to get a copy of this message | ||
Just to clarify something about inheritance. The following code :
class a
{ function call()
{ $this->toto();
}
function toto()
{ echo('Toto of A');
}
}
class b extends a
{ function toto()
{ echo('Toto of B');
}
}
$b=new b;
$b->call();
...will correctly display "toto of B" (that is, the function declared in the parent is
correctly calling the redefined function in the child)
--
http://www.php.net/manual/en/keyword.extends.php
http://master.php.net/manage/user-notes.php?action=edit+23428
http://master.php.net/manage/user-notes.php?action=delete+23428
http://master.php.net/manage/user-notes.php?action=reject+23428