note 109562 added to keyword.parent
| From: | amitdeopanwar at yahoo dot com | Date: | Sun, 29 Jul 2012 00:28:04 +0000 |
| Subject: | note 109562 added to keyword.parent | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189442@lists.php.net to get a copy of this message | ||
Is there anyway to reference parent's parent function?
for example:
class A
{
function test()
{
echo "A->test() called";
}
}
class B extends A
{
function test()
{
echo "B->test() called";
}
}
class C extends B
{
function test()
{
parent::test();
}
}
$obj=new C();
$obj->test(); //outputs B->test() called
What should i write in C::test() function so that it executes parent's parent::test() ie. the
output of $obj->test() is A->test() called.
----
Server IP: 69.147.83.197
Probable Submitter: 59.95.171.239
----
Manual Page -- http://www.php.net/manual/en/keyword.parent.php
Edit -- https://master.php.net/note/edit/109562
Del: integrated -- https://master.php.net/note/delete/109562/integrated
Del: useless -- https://master.php.net/note/delete/109562/useless
Del: bad code -- https://master.php.net/note/delete/109562/bad+code
Del: spam -- https://master.php.net/note/delete/109562/spam
Del: non-english -- https://master.php.net/note/delete/109562/non-english
Del: in docs -- https://master.php.net/note/delete/109562/in+docs
Del: other reasons-- https://master.php.net/note/delete/109562
Reject -- https://master.php.net/note/reject/109562
Search -- https://master.php.net/manage/user-notes.php