vrana Wed Dec 21 15:04:47 2005 EDT
Modified files: /phpdoc/en/appendices migration5.xml Log: Example when 'declare class before use' is necessary http://cvs.php.net/viewcvs.cgi/phpdoc/en/appendices/migration5.xml?r1=1.44&r2=1.45&diff_format=u Index: phpdoc/en/appendices/migration5.xml diff -u phpdoc/en/appendices/migration5.xml:1.44 phpdoc/en/appendices/migration5.xml:1.45 --- phpdoc/en/appendices/migration5.xml:1.44 Thu Dec 8 12:10:46 2005 +++ phpdoc/en/appendices/migration5.xml Wed Dec 21 15:04:47 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.44 $ --> +<!-- $Revision: 1.45 $ --> <appendix id="migration5"> <title>Migrating from PHP 4 to PHP 5</title> @@ -96,8 +96,9 @@ <listitem> <simpara> In some cases classes must be declared before used. It only happens - only if some of the new features of PHP 5 are used. Otherwise the - behaviour is the old. + only if some of the new features of PHP 5 (such as <link + linkend="language.oop5.interfaces">interfaces</link>) are used. + Otherwise the behaviour is the old. </simpara> </listitem> <listitem> @@ -127,11 +128,10 @@ </listitem> <listitem> <simpara> - If there are functions defined in the included file, they will be defined - in the main file, whether they are before or after the - <function>return</function> instruction. If the file is included twice, - PHP 5 issues fatal error because functions were already declared, while - PHP 4 doesn't complain about it. + 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. 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.