From 2177c639154a48110a853a71d7426d7520bcbceb Mon Sep 17 00:00:00 2001 From: Karoly Negyesi Date: Mon, 13 Aug 2012 07:15:46 +0000 Subject: [PATCH] Make include returns a lot more clear. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@327094 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/control-structures/include.xml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/language/control-structures/include.xml b/language/control-structures/include.xml index 2ff3d3cc2b..8ac7f84ec9 100644 --- a/language/control-structures/include.xml +++ b/language/control-structures/include.xml @@ -181,16 +181,19 @@ include 'file.php'; // Works. information. - Handling Returns: It is possible to execute a return - statement inside an included file in order to terminate processing in that - file and return to the script which called it. Also, it's possible to return - values from included files. You can take the value of the include call as - you would for a normal function. This is not, however, possible when including - remote files unless the output of the remote file has - valid PHP start - and end tags (as with any local file). You can declare the needed - variables within those tags and they will be introduced at whichever point - the file was included. + Handling Returns: include always returns + FALSE on failure. Unless overridden by the included file, + include returns 1 if the include was + successful. It is possible to execute a return + statement inside an included file in order to terminate processing in + that file and return to the script which called it. Also, it's possible + to return values from included files. You can take the value of the + include call as you would for a normal function. This is not, however, + possible when including remote files unless the output of the remote + file has valid PHP start + and end tags (as with any local file). You can declare the + needed variables within those tags and they will be introduced at + whichever point the file was included. Because include is a special language construct,