mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
378609b8a6
commit
eec101b31f
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue