language/oop5/visibility.xml
f5e5b54129045a7d02c5285a88cea0abff8ffb6f
...
...
@@ -4,9 +4,9 @@
4
4
<title>Visibility</title>
5
5
<para>
6
6
The visibility of a property, a method or (as of PHP 7.1.0) a constant can be defined by prefixing
7
-
the declaration with the keywords <emphasis>public</emphasis>,
8
-
<emphasis>protected</emphasis> or
9
-
<emphasis>private</emphasis>. Class members declared public can be
7
+
the declaration with the keywords <literal>public</literal>,
8
+
<literal>protected</literal> or
9
+
<literal>private</literal>. Class members declared public can be
10
10
accessed everywhere. Members declared protected can be accessed
11
11
only within the class itself and by inheriting and parent
12
12
classes. Members declared as private may only be accessed by the
...
...
@@ -16,9 +16,9 @@
16
16
<sect2 xml:id="language.oop5.visibility-members">
17
17
<title>Property Visibility</title>
18
18
<para>
19
-
Class properties must be defined as public, private, or
20
-
protected. If declared using <emphasis>var</emphasis>,
21
-
the property will be defined as public.
19
+
Class properties may be defined as public, private, or
20
+
protected. Properties declared without any explicit visibility
21
+
keyword are defined as public.
22
22
</para>
23
23
<para>
24
24
<example>
...
...
@@ -78,14 +78,6 @@ $obj2->printHello(); // Shows Public2, Protected2, Undefined
78
78
</programlisting>
79
79
</example>
80
80
</para>
81
-
<note>
82
-
<simpara>
83
-
The PHP 4 method of declaring a variable with the
84
-
<emphasis>var</emphasis> keyword is still supported for compatibility
85
-
reasons (as a synonym for the public keyword). In PHP 5 before 5.1.3, its
86
-
usage would generate an <constant>E_STRICT</constant> warning.
87
-
</simpara>
88
-
</note>
89
81
</sect2>
90
82

91
83
<sect2 xml:id="language.oop5.visiblity-methods">
...
...
@@ -309,7 +301,6 @@ Accessed the private method.
309
301
</example>
310
302
</sect2>
311
303
</sect1>
312
-
313
304
<!-- Keep this comment at the end of the file
314
305
Local variables:
315
306
mode: sgml
316
307