Where are the PHP 4 developers?

Submitted by Larry on 9 January 2008 - 9:40pm

Marco Tabini, of php|architect magazine fame among other things, has been openly disappointed at the death of PHP 4. Not because he likes PHP 4, but because of the "OMG you're discontinuing something that everyone's still using!" argument.

I like your magazine, Marco, but I have to disagree with you on this one. :-)

The problem is the source for that "everyone" claim. The most widely referenced stats are the Nexen stats, and according to them 70%+ of the world still uses PHP 4. Horrors! That means, as Marco claims:

that nearly three quarters of the developer population is essentially being hung out to dry.

Except that is not what the Nexen stats say at all. Let's have a look at the collection methodology (French, English). The data is based on HTTP headers only. Not on number of servers that are actually in use rather than just happen to have PHP installed, not on number of domains showing .php files, not on the number of pages returning headers indicating they were actually build with PHP of some version; just on the number of servers whose Apache header happens to say PHP in it.

Of course, the methodology listed doesn't say if it checks IIS headers, too. Or what severs were even polled, other than 11 million were used out of 28 million polled. Does it count virtual hosts separately or not?

Even if we assume that the Nexen stats are completely valid, however, they are valid for what they are testing, which is the number of servers returning a given PHP version in their header. That is not the same thing as the number of PHP developers in the world. At absolute best, one could argue that 3/4 of the Apache servers in the world are "being hung out to dry". That, of course, is assuming that they're all actually using PHP rather than just have it installed.

That also assumes that there's a single PHP developer market, which is also not true. I'd group PHP developers into a few categories, market-wise:

  • Dedicated app, controlled server. The developer gets to pick the version of PHP they want to use, so they'll pick whatever they want. Even if you're not doing OOP, anyone who has chosen to start new development on PHP 4 with no regard for PHP 5 in the past 2 years or so has simply not been paying attention. Dropping PHP 4 is not a problem here.
  • Dedicated app, uncontrolled server. The sysadmin dictates the version of PHP that is run, and the little developer peons say "thank you sir, may I have another". The sysadmin in this case is likely either demanding that they use the latest security release, in which case they should now be on either 4.4.8 or 5.2.5, or refusing to budge from what came pre-installed on their Red Hat box. Well, even the latest RHEL now ships with PHP 5.1.6. Red Hat agreed to provide support for older versions of RHEL for 5 years, not the PHP dev team. I'm sure Red Hat (and SuSE, Canonical, etc.) will be happy to "maintain" PHP 4.2 or whatever they ship with if you pay them a big enough support contract. Nothing wrong with dropping PHP 4 here, either, as someone else is already contractually required to support them if they want.
  • Custom app, shared server. This was the big stumbling block for most general-market developers, as they needed to remain compatible with some mythical majority of shared hosts that users (who neither know nor care what a PHP version is) were using. Well... there is no shortage of PHP 5-friendly hosts. This argument is gone, too. If someone is "forced" into PHP 5, there are plenty of places they can go for hosting, from tier-one professionals through mom-and-pop.
  • Off-the-shelf app. Whether commercial or open source, these apps had the same challenge as the previous group where they needed to run on any conceivable server. As a result, any worthwhile ones have run just fine thank you on PHP 5 for years now. If they don't, even today, that means they've been abandoned and you're SOL anyway (unless it's an open source app, in which case you can maintain it yourself; which still has nothing to do with PHP 5). Moving to PHP 5 here is no longer an issue with any program worth mentioning, and in fact will soon be a requirement for nearly all of them.

So uh, where's that 70%? The only people "hung out to dry" are those with legacy code that they never tested on PHP 5 whose sysadmins are going to now, suddenly, upgrade to PHP 5.2.5 and break everything. Of course, the PHP project has no legal relationship with those users. Red Hat may, in which case it's up to Red Hat either way. And the there's that "break everything" claim, which is FUD. Yes there are some issues, but if you were writing decent code in the first place then cleaning it up to make it PHP 5-friendly (as opposed to PHP 5-dependent, which no one is requiring you to do) should take maybe a day or two. All of the potential pitfalls are documented.

As an aside, that's yet another reason to leverage existing open source projects and communities rather than rolling your own proprietary code: Long before you need to upgrade someone else probably will, and so much of the work will be done for you. And if you help out, much of the work will be done for them, too, with a huge number of testers just waiting to find bugs. Drupal, Joomla, Typo3, WordPress, Squirrelmail, Gallery, Zend Framework, Qcodo, Cake, Symfony, and the many other open source PHP projects of note have long since either gotten PHP 5 compatibility or been abandoned (by definition, remember)? And when PHP 6 comes out, I'm quite confident that they will all be PHP 6 compatible long before most custom apps are.

So then, even if we assume that 70% of PHP developers are using 70% of random servers running PHP, and that they're all using proprietary, one-off applications on a server with a sysadmin who refuses to upgrade at a company that has no support contract with any distribution vendor... Where are they?

*cricket* *cricket* *cricket*

This is interesting indeed. Whenever I stand in a room full of developers, at a conference, a local PHP user group or at customers, I always ask "how many are still developing in PHP 4.x?". There's always less than 10% of people raising their hands.

We've also seen this at Zend a long time ago (see http://andigutmans.blogspot.com/2006/07/php-5-adoption-has-tipped.html) - most of our customers are "using" PHP 5.x for some time now. That doesn't mean they have servers running PHP 4.x - but new stuff they work on is almost always PHP 5.x.

These numbers and the fact that nobody's shouting makes me think that one or more of the following is true:

  • Nexen's numbers are completely off. While this is probably wrong, it is possible - just consider the collection method and the fact that people who still use PHP 4.x are probably less aware of hiding the fact that they are using PHP for example, or of the possibility to use IIS, or FastCGI PHP with Apache or Lighty or whatever (which will not show up on Nexen's statistics AFAIK).
  • Those 70% are in fact PHP users which are completely unaware of the fact that they are using PHP, or using PHP 4.x. Most of them are probably shared hosting customers who use some ready-made PHP app who's support for PHP 4.x was either dropped or will be dropped soon, but they don't bother upgrading - probably because they have no reason too or don't even know it's possible.
  • Much of those 70% are legacy apps, which are in the process of being replaced by new PHP 5.x apps. While this might be true for a part of those 70%, it's probably far from covering most of them.
  • People just don't care - they don't see any reason to fix something which they don't think is broken. Those again are not PHP developers - they are simply using a ready-made PHP application and they don't think there is any problem with it. Hell, that's why some security experts claim that 80% of all web apps have XSS or SQL Injection vulnerabilities - because ordinary people don't care unless you show them it's going to seriously hurt them (or unless they get hurt).
    • Well, in any case that's why the goPHP5 initiative is a good idea - it creates awareness mostly in developers and shared hosting providers which can then push indifferent users into upgrading.

Shahar, I don't think the audience of conferences is representative. People attending conferences and user groups are more 'into php' than those that don't, so it's logical that the adoption rate amongst that group is higher. There is however a large amount of developers that don't go to conferences, that don't read a lot of blogs, and that just 'do their thing' in their companies. Adoption rate there is much lower. If I look at customers I visit, I'd say it's about 70% that is on PHP now, but even that is not really representative, our customer base largely consists of companies that want to improve their PHP efforts, so they are again more likely to adopt php5 earlier than the average php developer.

But so far I like the end of life. At least most of the people still using php4 are now aware that they should finally move to php5, and it's become easier to convince them to do so.

Adoption rate there is much lower. If I look at customers I visit, I'd say it's about 70% that is on PHP now, but even that is not really representative, [...]

So PHP == PHP4 for you? ;-)

On the concession that there might truly be a "silent majority" of PHP4'ers out there, perhaps they're not screaming and kicking now because they knew the deadline was coming... maybe intuitively they'd been half-anxiously awaiting an end-of-life announcement about PHP4 ever since PHP5 turned 1 year old... perhaps they've even felt all along like that extra time between PHP5's first birthday and the finally-arrived PHP4 end-of-life announcement in 2007 was all borrowed time.

Just a possibility to consider... I've certainly felt this way in my PHP4 shop.

Someone should fork PHP4 and setup a PHP4-legacy project and charge people an arm and a leg for updates to it. :-) That would be enterpricey.

Then whoever doesn't want to run PHP5 still gets PHP4, and maybe even some support. ;-)

(Just kidding)

Don't think about PHP 4 users are only converting. Where are the new users for PHP 5? Are they as numerous as they were before?

Back in 2000, anyone wanting to set up a photo galery or a web site would have to rely on a PHP hosting and the installation of an application (may it be home made or a package). PHP hosting was cheap, easy to set up, and popular. Everyone jumped on the train, and turned to PHP (4 in that case).

As for PHP 5, for the same people trying to publish picutres, the situation is a lot different : to set up a galery, there are free solutions, monitored by someone else, free of charge and installation, and also popular. We can mention Ruby on Rail as the fashionable alternative, not counting Python and else. All in all, there are two missing crowds of users for PHP 5 : the lazy sod and the fashion victims.

Anyone setting up a galerie in 2002, and still using it (or not) will appear in the 70 %. The photo amateurs on flicker won't (or will just count as one) and won't be counting for PHP 5. Same for facebook versus wordpress installs.

More alternatives means that newer versions of PHP will be used by less people, and this will keep the percentage of PHP 4 high for yet another long era. The good news is that PHP 4 is definitely on the exit slope.

Now, if you have a way to tweak the numbers and make them more interesting, feel free to mail me. 28 millions servers are standing by to get polled :)

Thanks for those excellent posts to Marco and Larry.

There are a lot developers (including myself) who manage multiple existing sites written in PHP4 and are developing new sites in PHP5 at the same time. I think the stats about the usage of both versions are a little biased and need to separated in two containers, if possible: existing code and new projects.