diff --git a/language/variables.sgml b/language/variables.sgml index f35adc7f2d..277e219342 100644 --- a/language/variables.sgml +++ b/language/variables.sgml @@ -509,7 +509,18 @@ $bar = &test(); // Invalid. The scope of a variable is the context within which it is defined. - For the most part all PHP variables only have a single scope. + For the most part all PHP variables only have a single scope. This + single scope spans included and required files as well. For example: + + + +$a = 1; +include "b.inc"; + + + + Here the $a variable will be available within the included b.inc + script. However, within user-defined functions a local function scope is introduced. Any variable used inside a function is by default limited to the local function scope. For example: