diff --git a/language/variables.xml b/language/variables.xml index bf0b1f5dc0..88678bd1e7 100644 --- a/language/variables.xml +++ b/language/variables.xml @@ -1,5 +1,5 @@ - + Variables @@ -30,6 +30,7 @@ ]]> @@ -285,8 +287,10 @@ $bar = &test(); // Invalid. ]]> @@ -301,6 +305,7 @@ include "b.inc"; ]]> @@ -329,6 +335,7 @@ Test(); ]]> @@ -362,6 +370,7 @@ echo $b; ]]> @@ -393,12 +403,14 @@ echo $b; ]]> @@ -416,12 +428,14 @@ function Test () ]]> @@ -444,6 +458,7 @@ function Test() - - - - - Static initializers are evaluated when a function is defined, not - when it is executed. Thus you cannot make reference to any other - variables or initialize a static variable with the result of a - function call. The following example suggests a way around this: - - - - - - - - - - If the function you are calling has predictable return values, for - example, if it can never return null, this - can be further simplified (note the use of the identity operator - ===): - - - - - ]]> @@ -519,6 +487,7 @@ function Test() ]]> @@ -555,6 +525,7 @@ object(stdClass)(0) { ]]> @@ -626,7 +598,9 @@ Static object: object(stdClass)(1) { ]]> @@ -641,7 +615,9 @@ $a = "hello"; ]]> @@ -656,7 +632,9 @@ $$a = "world"; ]]> @@ -668,7 +646,9 @@ echo "$a ${$a}"; ]]> @@ -726,10 +706,12 @@ echo "$a $hello"; Simple form variable
Name:
+
@@ -767,6 +749,7 @@ echo "$a $hello"; More complex form variables
Name:
Email:
@@ -778,6 +761,7 @@ echo "$a $hello";
+
@@ -798,7 +782,9 @@ echo "$a $hello"; + @@ -840,7 +826,9 @@ echo "$a $hello"; ]]> @@ -856,9 +844,11 @@ setcookie("MyCookie[]", "Testing", time()+3600); SetCookie Example ]]> @@ -875,7 +865,9 @@ setcookie("Cart[$Count]", $item, time()+3600); ]]> @@ -902,7 +894,9 @@ echo $HOME; /* Shows the HOME environment variable, if set. */ variable name. For the reason, look at it: ]]> Now, what the parser sees is a variable named