Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm about to start working on a new commercial PHP project with a friend that will be licensed and sold as a script to run on your own shared hosting account or server.

Looking at the statistics ( 50.3% of PHP 5 installations are still PHP 5.2 or lower (43.5% being php 5.2). With this in mind, is it wise to ensure new software still supports PHP 5.2 given that such a high proportion of installations arent going to support modern PHP features such as namespacing and the likes of Composer.

share|improve this question

closed as primarily opinion-based by gnat, MichaelT, GlenH7, MainMa, Bart van Ingen Schenau Mar 23 at 8:23

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

50% is a lot. What do you think the percentage will be when you release your code? My own unsupported opinion is that if it's over 25% when you release, you should either support it or degrade gracefully. –  Dan Pichelman May 17 '13 at 14:02
That's my worry, we're looking a good 6 months I would estimate. Its annoying as hell trying to decide. Do we stick with 5.2 so we can continue supporting software that went end of life over 2 years ago, or not support it and get the project done a hell of a lot faster due to being able to use composer packages and a modern framework. –  Rick May 17 '13 at 14:06
Did you consider switching to something "better" than PHP, e.g. ocsigen or opa; it might enhance much your productivity (once you have learned these) ? –  Basile Starynkevitch Mar 21 at 11:09

2 Answers 2

I don't think you can rely on statistics to show you this or not; the answer will depend more on who your prospective clients are.

Personally, I think you should be aiming to support PHP 5.3, as the new features really do make a significant difference. Performance is better, for a start.

If you want to appeal to the widest possible market, then support PHP 5.2, but at the end of the day, people will not upgrade unless they need to, which makes supporting older versions a bit of a circular problem; you'll have to support it in perpetuity.

share|improve this answer
Well, a lot of people still run on shared or managed hosting, so they can't really control which PHP version they're running. –  tdammers May 17 '13 at 14:09
@tdammers True, but the OP suggested that this will be a commercial project. In that situation, you'd have to assume that the customer will have more control over their environment. Like I said as well, shared hosting companies simply won't upgrade unless their customers demand it - so supporting older versions just delays the inevitable. –  Stephen Orr May 17 '13 at 14:10
Shared hosting companies actually do upgrade without direct customer intervention, if only out of security consideration, or because they are upgrading their whole OS anyway and the new release comes with a newer PHP. –  tdammers May 17 '13 at 14:11
@tdammers Fair point - I've dealt with some providers who just would never upgrade, and others who were more than happy to do so. –  Stephen Orr May 17 '13 at 14:13
Just to clarify, when I say its a commercial project, I meant it will be sold/licensed out as a script for people to use. –  Rick May 17 '13 at 14:15

I would say use the latest php5.5 as they are continuously developing so why not use the latest one plus you need to keep in mind MySQL are developing too. MySQL is about to be terminated and MySQLi and PDO comes into place and php5.5 supports both of them plus it comes with phar all you need to install pear to use other people's code

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.