For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > August 2005 > PHP 5: Will it hurt?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP 5: Will it hurt?
Smitro

2005-08-26, 6:56 pm

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.
Jerry Stuckle

2005-08-26, 6:56 pm

Smitro wrote:
> 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.


Smitro,

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.
jstucklex@attglobal.net
==================
Smitro

2005-08-26, 6:56 pm

> It's the things that 'shouldn't affect you' which will get you every time!

True, true.
Wayne

2005-08-26, 6:56 pm

On Sat, 27 Aug 2005 07:38:46 +1000, Smitro <nospam@myh0use.c0m> wrote:

>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?


I'm currently do all new development in PHP5.

>is there a
>lot of people out their holding back?


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

>My biggest worry is will it break my site?


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.

Henk Verhoeven

2005-08-27, 6:55 pm

Smitro wrote:

> 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.


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
http://www.php.net/manual/en/migrat...ncompatible.php 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 ws, 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.

Greetings,

Henk Verhoeven,
www.phpeanuts.org.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com