tags:

views:

951

answers:

6

I have a site that is written completely in PHP4 - the supported version on my hosting at the time. After tons of time on this language, I've come to see that PHP5 has a lot of stuff that I think would be useful to me.

Two questions:

  1. Would switching my hosting to PHP5 cause any serious damage to existing PHP4 scripting?

  2. Is PHP5 considered the standard, or are most people still using PHP4?

See also

Difference between php 4 and php 5?

+5  A: 
  1. Depends on the quantity/quality of the PHP4 code involved. Some code is compatible, some is not-- there's a good chance you will need to make at least one source modification, so if you're not a developer, this is not a good idea.

  2. PHP5 is (should be) by now the standard, yes. People are still using PHP4 however, the same way people still use COBOL. For new apps you should be looking at PHP5

Loren Segal
thanks....didn't know how behind the times i was
johnnietheblack
+3  A: 

The PHP manual has a list of changes that will affect backwards compatibility.

Bill the Lizard
+3  A: 

Yes, PHP5 is now considered standard.

You shouldn't have any big problems migrating. probably few warnings could appear, but you should be able to quickly resolve it. Check for passing by reference in your code.

Turn error_reporting to E_ALL to see all errors and warnings thrown.

dusoft
my site is about 70 pages long (non-dynamic)...hopefully there wont be that many
johnnietheblack
if it is mostly static, then you are good to go.
dusoft
hhaha what i meant was...70 pages of static coding, each with dynamic parts.
johnnietheblack
+3  A: 

There was a question on this very topic two months back, which had answers giving plenty of good information.

Keith Gaughan
+1  A: 

Most headaches will come from the php4 OO model, namely constructor names and method access restrictions. While solving these issues will probably make your code work. In the long run you might want to take advantage of the new OO engine introduced in php5 by doing some refactoring.

facildelembrar
+1  A: 

And don't forget, officially, PHP4 is now discountinued. In other words, if a security issure are dicovered in php4, officially no fix will be available.

Support for PHP 4 has been discontinued since 2007-12-31. Please consider upgrading to PHP 5.2. The release below is the last PHP 4 release. Php website