From 6ae6e45e80bebd8f391fb48bddfc69de97a62ef7 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 8 Nov 2004 22:26:22 +0000 Subject: [PATCH] include and return in PHP 4 (bug #30723) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@172298 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/control-structures.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/language/control-structures.xml b/language/control-structures.xml index ed4bf14158..11ec91ab55 100644 --- a/language/control-structures.xml +++ b/language/control-structures.xml @@ -1,5 +1,5 @@ - + Control Structures @@ -1539,7 +1539,8 @@ echo $bar; // prints 1 If there are functions defined in the included file, they can be used in the main file independent if they are before return or after. If the file is included twice, PHP 5 issues fatal error because functions - were already declared, while PHP 4 doesn't complain about it. + were already declared, while PHP 4 doesn't complain about functions + defined after return. It is recommended to use include_once instead of checking if the file was already included and conditionally return inside the included file.