>-----Ursprüngliche Nachricht----- >Von: Michael Borchers >Gesendet: Mittwoch, 2. Februar 2005 09:20 >An: php (E-Mail) >Betreff: [php] php5 > > >uhh, >just updated our server to php5 >and right from the start a lot of the functionson my phorum stopped working >because they were supposed to be declared before f.e. > >Fatal error: Cannot redeclare undo_htmlspecialchars() (previously declared in /home/httpd/docs/.../common.php:90) in /home/httpd/docs/.../common.php on line 98 > >is that one typical php5 probs, functions though they were definitely NOT declared before seem to get lost? has it got to do with this? // If there are functions defined in the included file, they can be used in the main file independent if they are before return() <function.return.php> 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 include_once() <function.include-once.php> instead of checking if the file was already included and conditionally return inside the included file. include_once() <function.include-once.php> and require_once() <function.require-once.php> first normalize the path of included file on Windows so that including A.php and a.php include the file just once. http://www.php.net/manual/en/migration5.incompatible.php // should include no longer be used, just include_once?
php::bar PHP Wiki - Listenarchive