vrana Mon Nov 8 17:26:25 2004 EDT
Modified files: /phpdoc/en/language control-structures.xml Log: include and return in PHP 4 (bug #30723) http://cvs.php.net/diff.php/phpdoc/en/language/control-structures.xml?r1=1.109&r2=1.110&ty=u Index: phpdoc/en/language/control-structures.xml diff -u phpdoc/en/language/control-structures.xml:1.109 phpdoc/en/language/control-structures.xml:1.110 --- phpdoc/en/language/control-structures.xml:1.109 Tue Oct 26 21:49:33 2004 +++ phpdoc/en/language/control-structures.xml Mon Nov 8 17:26:22 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.109 $ --> +<!-- $Revision: 1.110 $ --> <chapter id="language.control-structures"> <title>Control Structures</title> @@ -1539,7 +1539,8 @@ If there are functions defined in the included file, they can be used in the main file independent if they are before <function>return</function> 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 <function>return</function>. It is recommended to use <function>include_once</function> instead of checking if the file was already included and conditionally return inside the included file.