PHP 5: Will it hurt?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I'm currently on using PHP 4. (what ever the  
latest is) and I'm looking at moving to PHP5. Just  
wondering, should I have moved by now? is there a  
lot of people out their holding back?

My biggest worry is will it break my site? I had a  
quick wonder through the Release notes and it  
doesn't look like any functions I normally use  
have been taken out.  Just looking for some  
feedback. and what it has done to others.

Re: PHP 5: Will it hurt?

Smitro wrote:
Quoted text here. Click to load it


There are some changes in PHP5.  You'll want to go eventually, but only you can  
decide if now is the right time.  It all depends on your site and what it does.

If you do change, ensure you do a lot of testing before you go "live".  It's the  
things that 'shouldn't affect you' which will get you every time!

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: PHP 5: Will it hurt?

Quoted text here. Click to load it

True, true.

Re: PHP 5: Will it hurt?

Quoted text here. Click to load it

I'm currently do all new development in PHP5.

Quoted text here. Click to load it

All my old sites are running PHP4 with absolutely no intention of
upgrading them to PHP5.  Too much trouble.

Quoted text here. Click to load it

Probably.  PHP5 has a different (better) way of doing a lot of stuff.
However, they have taken lots of care in working on backwards
compatitibly.  Your best bet is move your site to PHP5 in a test
environment and make the necessary modifications to have it work
right.  If you don't use objects/classes you might not have to change
anything at all.

Re: PHP 5: Will it hurt?

Smitro wrote:

Quoted text here. Click to load it

Hi Smitro,

I think upgrading is not a big issue for most people because website  
hosting providers do not seem to be very quick with upgrading their  
hosting services. But php5 is included in Fedora core 4, which was  
annouced in june 2005, so maybe things are about to change.

If you are not using objects, there is a good chance that it will simply  
work. But to prevent possible problems you can look into and search your  
code for the use of variables and functions that are not entirely  
compatible (With an editor like UltraEdit searching all files in a  
folder and all its subfolders is easy). Probably your code does not do  
the kind of things that are no longer supported. But if you are not  
sure, you can prevent them from breaking your code by adding some  
conditions that check for situations that will become a problem in php5  
and log them if they occur. Then you put it to run on your site, still  
on php4, wait for several weeks, then download the problems log. If you  
use the same function for all logging, it should be easy enough to find  
and remove the logging code after you upgraded to php5.

And even if you do use objects: with phpPeanuts i have managed to make  
allmost the entire framework portable: it does the same on both php4 and  
php5. This took several days work, but OK, this is hundreds of Kbs of  
OOP code. I ended up with only a few functions that are version specific  
and the framework now automatically loads the right implementation. And  
of course there are a few rules to attend if you want your own  
applications to be portable too. If you need your site to be portable,  
you can download a portable version and take a look at it, the version  
specific functions are included from classes/generalFunctions.php and  
there the readme has a section on portability.


Henk Verhoeven,

Site Timeline