From c58e78bda6714873fda21b73ddcaa70583fca13e Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Tue, 12 Aug 2008 21:26:21 +0000 Subject: [PATCH] Document that interfaces can have constants git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@264720 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/oop5/constants.xml | 11 ++++++----- language/oop5/interfaces.xml | 37 +++++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 8 deletions(-) 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 + + ]]>