language/oop5/paamayim-nekudotayim.xml
e3d36be7d64f1fd47612a91297c7f6d75e4e50c7
...
...
@@ -6,9 +6,12 @@
6
6
<para>
7
7
The Scope Resolution Operator (also called Paamayim Nekudotayim) or in
8
8
simpler terms, the double colon, is a token that allows access to
9
-
<link linkend="language.oop5.static">static</link>,
10
-
<link linkend="language.oop5.constants">constant</link>, and overridden
11
-
properties or methods of a class.
9
+
a <link linkend="language.oop5.constants">constant</link>,
10
+
<link linkend="language.oop5.static">static</link> property,
11
+
or <link linkend="language.oop5.static">static</link> method
12
+
of a class or one of its parents.
13
+
Moreover, static properties or methods can be overriden via
14
+
<link linkend="language.oop5.late-static-bindings">late static binding</link>.
12
15
</para>
13
16

14
17
<para>
...
...
@@ -17,7 +20,7 @@
17
20
</para>
18
21

19
22
<para>
20
-
As of PHP 5.3.0, it's possible to reference the class using a variable.
23
+
It's possible to reference the class using a variable.
21
24
The variable's value can not be a keyword (e.g. <literal>self</literal>,
22
25
<literal>parent</literal> and <literal>static</literal>).
23
26
</para>
...
...
@@ -39,7 +42,7 @@ class MyClass {
39
42
}
40
43

41
44
$classname = 'MyClass';
42
-
echo $classname::CONST_VALUE; // As of PHP 5.3.0
45
+
echo $classname::CONST_VALUE;
43
46

44
47
echo MyClass::CONST_VALUE;
45
48
?>
...
...
@@ -69,7 +72,7 @@ class OtherClass extends MyClass
69
72
}
70
73

71
74
$classname = 'OtherClass';
72
-
echo $classname::doubleColon(); // As of PHP 5.3.0
75
+
$classname::doubleColon();
73
76

74
77
OtherClass::doubleColon();
75
78
?>
...
...
@@ -78,7 +81,7 @@ OtherClass::doubleColon();
78
81
</example>
79
82

80
83
<para>
81
-
When an extending class overrides the parents definition of a method,
84
+
When an extending class overrides the parent's definition of a method,
82
85
PHP will not call the parent's method. It's up to the extended class
83
86
on whether or not the parent's method is called. This also applies to <link
84
87
linkend="language.oop5.decon">Constructors and Destructors</link>, <link
...
...
@@ -121,7 +124,6 @@ $class->myFunc();
121
124
</para>
122
125

123
126
</sect1>
124
-

125
127
<!-- Keep this comment at the end of the file
126
128
Local variables:
127
129
mode: sgml
128
130