diff --git a/language/oop5/static.xml b/language/oop5/static.xml index 98b3288e2d..bdcefbc24f 100644 --- a/language/oop5/static.xml +++ b/language/oop5/static.xml @@ -1,5 +1,5 @@ - + Static Keyword @@ -32,6 +32,14 @@ Calling non-static methods statically generates an E_STRICT level warning. + + Like any other PHP static variable, static properties must be + initialized using a literal or constant; expressions are not + allowed. So while you may initialize a static property to an + integer or array (for instance), you may not initialize it to + another variable, to a function return value, or to an object. + + 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,