Where are the PHP 4 developers?
Posted:
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
Comments
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:
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.
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.
So PHP == PHP4 for you? ;-)
Just a possibility to consider... I've certainly felt this way in my PHP4 shop.
Then whoever doesn't want to run PHP5 still gets PHP4, and maybe even some support. ;-)
(Just kidding)
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.