Protected members cannot be accessed by parent classes

-- 
Provided by anonymous 62572 (tunght13488@gmail.com)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337719 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2015-09-02 21:58:23 +00:00
parent 378609b8a6
commit eec101b31f

View file

@ -8,9 +8,9 @@
<emphasis>protected</emphasis> or
<emphasis>private</emphasis>. Class members declared public can be
accessed everywhere. Members declared protected can be accessed
only within the class itself and by inherited and parent
classes. Members declared as private may only be accessed by the
class that defines the member.
only within the class itself and by inherited classes. Members
declared as private may only be accessed by the class that defines
the member.
</para>
<sect2 xml:id="language.oop5.visibility-members">
@ -178,7 +178,7 @@ class Foo extends Bar
}
}
$myFoo = new Foo();
$myFoo = new foo();
$myFoo->test(); // Bar::testPrivate
// Foo::testPublic
?>