diff --git a/language/oop5/constants.xml b/language/oop5/constants.xml index 1a4f3fb3e5..9f7abd9eb5 100644 --- a/language/oop5/constants.xml +++ b/language/oop5/constants.xml @@ -1,5 +1,5 @@ - + Class Constants @@ -11,13 +11,16 @@ The value must be a constant expression, not (for example) a variable, a class member, result of a mathematical operation or a function call. - + + Its also possible for interfaces to have constants. Look at + the interface documentation for + examples. + As of PHP 5.3.0, it's possible to reference the class using a variable. The variable's value can not be a keyword (e.g. self, parent and static). - Defining and using a constant @@ -64,13 +67,11 @@ EOT; Unlike heredocs, nowdocs can be used in any static data context. - Nowdoc support was added in PHP 5.3.0. - + Object Interfaces @@ -37,6 +37,14 @@ + + <literal>Constants</literal> + + Its possible for interfaces to have constants. Interface constants works exactly + like class constants. They cannot + be overridden by a class/interface that inherits it. + + &reftitle.examples; @@ -157,17 +165,40 @@ class d implements c { } - public function bar() { } - public function baz() { } } ?> +]]> + + + + Interfaces with constants + + ]]>