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 (http://w3techs.com/technologies/details/pl-php/5/all) 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.

  • 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. Commented May 17, 2013 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.
    – Sk446
    Commented May 17, 2013 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) ? Commented Mar 21, 2015 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.

  • 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
    Commented May 17, 2013 at 14:09
  • 1
    @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.
    – Steve Hill
    Commented May 17, 2013 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
    Commented May 17, 2013 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.
    – Steve Hill
    Commented May 17, 2013 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.
    – Sk446
    Commented May 17, 2013 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

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