note 27433 added to keyword.parent
| From: | aid at logic dot org dot uk | Date: | Thu, 05 Dec 2002 18:27:50 +0000 |
| Subject: | note 27433 added to keyword.parent | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40389@lists.php.net to get a copy of this message | ||
With regard to the chaining of Constrcutures, surely this is a simple and replaible method..?
<?php
class A
{
function A()
{
print "Constructor A<br>\n" ;
}
}
class B extends A
{
function B()
{
parent::A () ;
print "Constructor B<br>\n" ;
}
}
class C extends B
{
function C()
{
parent::B ();
print "Constructor C<br>\n" ;
}
}
$o = new C;
?>
Which outputs,
Constructor A
Constructor B
Constructor C
--
http://www.php.net/manual/en/keyword.parent.php
http://master.php.net/manage/user-notes.php?action=edit+27433
http://master.php.net/manage/user-notes.php?action=delete+27433
http://master.php.net/manage/user-notes.php?action=reject+27433