Page 1 of 1

php4 files to php5

Posted: Sun Sep 30, 2007 7:56 am
by leewad
Hi

Does anyone know the easiest way of converting php4 files into php5, I have lots of files which now dont work with php5 so need someway of testing the files to see which part of the code is invalid. Is there any software available to convert the files into php5 of software that will test the code and highlight the invalid sections?

Thanks

Posted: Sun Sep 30, 2007 8:02 am
by jeffery
I am not aware of any such software but this might help you in the process:

http://php.net/manual/en/faq.migration5.php

Posted: Sun Sep 30, 2007 10:22 am
by superdezign
PHP4 files are completely compatible with PHP5. The only problems would be deprecated syntax, namely using short tags (i.e. <?) instead of regular <?php tags. If you do a "Find and Replace" on "<?= " and replace it with "<?php echo ", and then do the same on "<? " and replace it with "<?php " (remember to keep the space at the end of the strings in the search and replace queries as I have).

Posted: Sun Sep 30, 2007 3:17 pm
by John Cartwright
Different configuration settings on the server may be the reason also, namely register globals is a common issue.