mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Minor clarity fixes.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288506 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
99270d79ee
commit
e0a9a1084e
1 changed files with 14 additions and 9 deletions
|
@ -4,17 +4,21 @@
|
|||
<title>Visibility</title>
|
||||
<para>
|
||||
The visibility of a property or method can be defined by prefixing
|
||||
the declaration with the keywords: public, protected or
|
||||
private. 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.
|
||||
the declaration with the keywords <emphasis>public</emphasis>,
|
||||
<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.
|
||||
</para>
|
||||
<sect2 xml:id="language.oop5.visibility-members">
|
||||
<title>Property Visibility</title>
|
||||
<para>
|
||||
Class properties must be defined with public, private, or protected.
|
||||
Class properties must be defined as public, private, or
|
||||
protected. If declared using <emphasis>var</emphasis> without an
|
||||
explicit visibility keyword, the property will be defined as
|
||||
public.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
|
@ -85,8 +89,9 @@ $obj2->printHello(); // Shows Public, Protected2, Undefined
|
|||
<sect2 xml:id="language.oop5.visiblity-methods">
|
||||
<title>Method Visibility</title>
|
||||
<para>
|
||||
Class methods must be defined with public, private, or protected. Methods
|
||||
without any declaration are defined as public.
|
||||
Class methods may be defined as public, private, or
|
||||
protected. Methods declared without any explicit visibility
|
||||
keyword are defined as public.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
|
|
Loading…
Reference in a new issue