Go Back   Web Server Hosting Forum by BODHost > Support > PHP Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-09, 21:06
BOD Member
 
Join Date: Jan 2009
Posts: 98
Default Are there any advantages to using 4?

I've noticed that some people are still using PHP 4, are there any advantages to this?

From my experience, all the scripts that worked using PHP 4, worked great on PHP 5. So therefore I've just been using that even though it's not an explicit requirement for most of my scripts. But perhaps there is an advantage in the previous version that I'm not aware of..
Reply With Quote
  #2 (permalink)  
Old 02-03-09, 17:26
BOD Member
 
Join Date: Nov 2008
Posts: 62
Default

There are several differences, both in configuration, and the way certain functions and expressions are handled. PHP 4 has a larger installed base at this point, but since PHP is server side, this is generally not going to effect the end user. If you have PHP 4 already, there is not much reason to upgrade to PHP 5, but if you are not already using PHP, and are asking which one to go with, I would suggest PHP 5.
Reply With Quote
  #3 (permalink)  
Old 02-03-09, 18:31
carl owen's Avatar
Super Moderator
 
Join Date: Nov 2008
Posts: 1,059
Smile

Andy is right. There are several differences between both the versions of PHP but if you are using PHP 4 then it is not that necessary to upgrade to PHP 5. I would like to add that when someone uses one version for a longer time, one gets used to it and understands almost everything about it. Also, when someone uses the same version for a longer time he gets comfortable with it as he gets an idea about the technical aspects of it and does not want to upgrade. This might be the case with the people who are using PHP 4 and do not upgrade to PHP 5.
Reply With Quote
  #4 (permalink)  
Old 02-04-09, 06:26
BOD Member
 
Join Date: Jan 2009
Posts: 73
Default

Quote:
Originally Posted by carl owen View Post
Andy is right. There are several differences between both the versions of PHP but if you are using PHP 4 then it is not that necessary to upgrade to PHP 5. I would like to add that when someone uses one version for a longer time, one gets used to it and understands almost everything about it. Also, when someone uses the same version for a longer time he gets comfortable with it as he gets an idea about the technical aspects of it and does not want to upgrade. This might be the case with the people who are using PHP 4 and do not upgrade to PHP 5.
True - there can be a lot of work involved in porting code from php4 to php 5 - I have done this once. It is mostly the same, but certain 'features' (bugs) in php 4 that get used to make cool things happen just don't work in php 5, so you have to find a work around. it was after this porting that I started writing everything in a more object orientated way - lots of little files containing functions that I referenced from the main code. That way I only have to change one function and all my code is fixed everywhere that function exists and I don't have to go searching through lots of files for lots of instances of a line of code that is broken. it just means that you get a lot of includes and pass a lot of variables about but overall it makes for easier maintainability. Kinda.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 01:42.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.