Easy to develop application to support PHP4 and PHP5?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Easy to develop application to support PHP4 and PHP5?

Post by georgeoc »

Hi,

I have until now been developing my Open Source app for PHP 4 exclusively, as I have to support a wide user-base who mostly don't yet have access to PHP 5. However, I have just been wondering how hard it is to make an application work without errors in both PHP 4 and 5. I would love to develop for both versions simultaneously if it's not to complex, as it opens up the most possibilities for my users.

I'm sure this topic has been thrashed to death in many discussions, but I would appreciate a link or two to sites which comprehensively list the areas to consider when porting a PHP 4 app to run in both PHP 4 and 5. I am aware of the improvements in v5, and believe me, I would drop v4 now if I had the choice, but I really can't. All I'm looking for is a list of problem areas and possible solutions to make the code friendly to both versions (for instance, how to deal with the different forms of class constructor).

Thanks!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

you wrote:how to deal with the different forms of class constructor
using ph4 style constructors doesn't cause any problems in php5
georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Post by georgeoc »

Thanks. What about other issues? :wink:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

georgeoc
Forum Contributor
Posts: 166
Joined: Wed Aug 09, 2006 4:21 pm
Location: London, UK

Post by georgeoc »

Marvellous!

I think I'm going to be very happy here at devnetwork.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

E_ALL is usually no problem for PHP 4 and 5. You'll run into troubles if you try to go E_STRICT in PHP 5 though.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Post Reply