Forum Moderators: coopster
I have a hosting plan where I control what to have installed. Among all, there are PHP 4.4.8 and PHP 5.2.6.
I personally don’t know anything about the difference between the two, but I do use PHP for some basic stuff (other people make it for me).
All what I have works fine under both 4 or 5, so far.
As a someone who knows PHP very well, how would you explain the difference (in short), and why would you use one over another?
If you really don’t care, please reply as that is also an answer.
Thanks
The big thing is that support for PHP4 has ended completely. No more updates, no more security fixes, nothing. It's dead and buried. If there's problems with the last release (4.4.9) those problems are staying for good.
Given this, PHP5 is the only good option for any development and deployment at this stage. Until they release PHP6 :)
The largest reason for upgrading is the one that has already been made. PHP4 is no longer supported. So if you can choose then get everything upgraded. PHP4 code should work on php5, so the transition should be easy...having said that check it all first, just in case ;)
New functions that make programming easier
XML support is better
DOM support is better
Date/time handling is better
I've also found bugs in some areas where the 4.x version was not addressed but PHP5 handles itself as I expect. I do development on a PHP5 platform and sometimes have to port the code to a PHP4 installation and I've run into issues. I'm trying to recall some of those areas and I believe FTP was one. However, I'm certain there were others, just cannot recall right now. I can go through comments in all the code I have and find my PHP4 workarounds but that would take me awhile.
Do yourself a favor, go with 5 :)
Thanks
Chris
I do development on a PHP5 platform and sometimes have to port the code to a PHP4 installation and I've run into issues. I'm trying to recall some of those areas and I believe FTP was one.
If you have PHP5 code that takes advantage of the new Object/class model then it could be very difficult to go back to PHP4. However, relatively easy to modify PHP4 code to work on a PHP5 platform (and most of the time you won't have to change a thing).
PHP5.0.0 to PHP5.3.0 offers zend.ze1_compatibility_mode to enable compatibility with PHP4 in some areas - if you should need it.
Also new for developers...
- Exception handling (Although not as useful as in other languages IMHO) [webmasterworld.com]
The OOP and XML handling is enough for me to not want to go back to PHP4. Only if you had a big app that you had to support and was stubborn enough to only work under PHP4 would you run PHP4, IMHO.
Migrating from PHP 4 to PHP 5.0.x [uk2.php.net]