note 56409 added to language.oop5.visibility
| From: | gugglegum at gmail dot com | Date: | Thu, 01 Sep 2005 18:01:57 +0000 |
| Subject: | note 56409 added to language.oop5.visibility | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94615@lists.php.net to get a copy of this message | ||
Parent class can access protected members of its childs.
<?php
class A
{
public function getProtected()
{
return B::$protected;
}
}
class B extends A
{
protected static $protected = 'Hi, I am protected property of class B!';
}
echo A::getProtected();
?>
It works at least in PHP 5.0.4.
----
Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56409
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56409&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56409&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56409&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56409&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56409&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56409&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56409&report=yes
Search -- http://master.php.net/manage/user-notes.php