note 117570 added to language.oop5.inheritance
| From: | akashwebdev at gmail dot com | Date: | Wed, 01 Jul 2015 05:59:18 +0000 |
| Subject: | note 117570 added to language.oop5.inheritance | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203003@lists.php.net to get a copy of this message | ||
The Idea that multiple inheritence is not supported is correct but with tratits this can be
reviewed.
for e.g.
<?php
trait custom
{
public function hello()
{
echo "hello";
}
}
trait custom2
{
public function hello()
{
echo "hello2";
}
}
class inheritsCustom
{
use custom, custom2
{
custom2::hello insteadof custom;
}
}
$obj = new inheritsCustom();
$obj->hello();
?>
----
Server IP: 72.52.91.14
Probable Submitter: 115.254.29.178
----
Manual Page -- http://php.net/manual/en/language.oop5.inheritance.php
Edit -- https://master.php.net/note/edit/117570
Del: integrated -- https://master.php.net/note/delete/117570/integrated
Del: useless -- https://master.php.net/note/delete/117570/useless
Del: bad code -- https://master.php.net/note/delete/117570/bad+code
Del: spam -- https://master.php.net/note/delete/117570/spam
Del: non-english -- https://master.php.net/note/delete/117570/non-english
Del: in docs -- https://master.php.net/note/delete/117570/in+docs
Del: other reasons-- https://master.php.net/note/delete/117570
Reject -- https://master.php.net/note/reject/117570
Search -- https://master.php.net/manage/user-notes.php