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/migrati...compatible.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 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.
Greetings,
Henk Verhoeven,
www.phpeanuts.org.