diff --git a/language/control-structures/include-once.xml b/language/control-structures/include-once.xml index 6f1acac202..ad6f94eae6 100644 --- a/language/control-structures/include-once.xml +++ b/language/control-structures/include-once.xml @@ -1,5 +1,5 @@ - + <function>include_once</function> @@ -37,20 +37,20 @@ - - Be aware, that the behaviour of include_once - and require_once may not be what you expect - on a non case sensitive operating system (such as Windows). - - <function>include_once</function> is case insensitive on Windows - + + Be aware, that the behaviour of include_once + and require_once may not be what you expect + on a non case sensitive operating system (such as Windows). + + <function>include_once</function> is case insensitive on Windows + ]]> - + This behaviour changed in PHP 5 - the path is normalized first so that C:\PROGRA~1\A.php is realized the same as @@ -58,7 +58,9 @@ include_once "A.php"; // this will include a.php again on Windows! (PHP 4 only) + &warn.no-win32-fopen-wrapper; + See also include, require, require_once, diff --git a/language/control-structures/include.xml b/language/control-structures/include.xml index 99e07fa483..96a65d8d1a 100644 --- a/language/control-structures/include.xml +++ b/language/control-structures/include.xml @@ -1,5 +1,5 @@ - + <function>include</function> @@ -8,17 +8,17 @@ the specified file. - The documentation below also applies to require. - The two constructs are identical in every way except how they handle - failure. They both produce a - Warning, but require - results in a Fatal Error. - In other words, use require if you want - a missing file to halt processing of the page. include does - not behave this way, the script will continue regardless. Be sure to have an - appropriate include_path setting as well. - Be warned that parse error in included file doesn't cause processing halting - in PHP versions prior to PHP 4.3.5. Since this version, it does. + The documentation below also applies to require. + The two constructs are identical in every way except how they handle + failure. They both produce a + Warning, but require + results in a Fatal Error. + In other words, use require if you want + a missing file to halt processing of the page. include does + not behave this way, the script will continue regardless. Be sure to have an + appropriate include_path setting as well. + Be warned that parse error in included file doesn't cause processing halting + in PHP versions prior to PHP 4.3.5. Since this version, it does. Files for including are first looked for in each include_path entry @@ -33,18 +33,18 @@ is looked only in the current working directory. - When a file is included, the code it contains inherits the - variable scope of the - line on which the include occurs. Any variables available at that line - in the calling file will be available within the called file, from that - point forward. - However, all functions and classes defined in the included file have the - global scope. + When a file is included, the code it contains inherits the + variable scope of the + line on which the include occurs. Any variables available at that line + in the calling file will be available within the called file, from that + point forward. + However, all functions and classes defined in the included file have the + global scope. - - Basic <function>include</function> example - + + Basic <function>include</function> example + ]]> - - + + - If the include occurs inside a function within the calling file, - then all of the code contained in the called file will behave as - though it had been defined inside that function. So, it will follow - the variable scope of that function. - An exception to this rule are magic constants which are - evaluated by the parser before the include occurs. + If the include occurs inside a function within the calling file, + then all of the code contained in the called file will behave as + though it had been defined inside that function. So, it will follow + the variable scope of that function. + An exception to this rule are magic constants which are + evaluated by the parser before the include occurs. - + Including within functions - + - When a file is included, parsing drops out of PHP mode and - into HTML mode at the beginning of the target file, and resumes - again at the end. For this reason, any code inside the target - file which should be executed as PHP code must be enclosed within - valid PHP start - and end tags. + When a file is included, parsing drops out of PHP mode and + into HTML mode at the beginning of the target file, and resumes + again at the end. For this reason, any code inside the target + file which should be executed as PHP code must be enclosed within + valid PHP start + and end tags. - If "URL fopen wrappers" - are enabled in PHP (which they are in the default configuration), - you can specify the file to be included using a URL (via HTTP or - other supported wrapper - see for a list - of protocols) instead of a local pathname. If the target server interprets - the target file as PHP code, variables may be passed to the included - file using a URL request string as used with HTTP GET. This is - not strictly speaking the same thing as including the file and having - it inherit the parent file's variable scope; the script is actually - being run on the remote server and the result is then being - included into the local script. + If "URL fopen wrappers" + are enabled in PHP (which they are in the default configuration), + you can specify the file to be included using a URL (via HTTP or + other supported wrapper - see for a list + of protocols) instead of a local pathname. If the target server interprets + the target file as PHP code, variables may be passed to the included + file using a URL request string as used with HTTP GET. This is + not strictly speaking the same thing as including the file and having + it inherit the parent file's variable scope; the script is actually + being run on the remote server and the result is then being + included into the local script. &warn.no-win32-fopen-wrapper; @@ -214,7 +214,7 @@ if ((include 'vars.php') == 'OK') { <function>include</function> and the <function>return</function> statement - + ]]> - + @@ -273,7 +273,7 @@ echo $bar; // prints 1 Using output buffering to include a PHP file into a string - + ]]> - +