PHP 5 Only Plugins: Good, Bad, Evil?
A little while back I asked whether WordPress should produce an explicitly PHP 5 only version. Reaction was mixed, but ultimately I think Matt has some good reasons for not doing so. This has come to my mind again since I updated my Tabbed Sidebars plugin to use objects and succeeded in messing up the PHP 4 compatibility. I am now considering whether to make future plugins without PHP 4 compatability.
At the heart of my desire for PHP 5 only versions is the fact that I actually just prefer PHP 5. It is the version I learned PHP on and so every compatibility matter seems a back step, even if the reality is different.
I also feel that PHP 5 is a route to being a better programmer overall. PHP 4 doesn’t support Private and Protect members or Try… Catch blocks for example.
Note that none of this is really about doing things. Sure the object support is better as is the XML support but that isn’t my motivation. I would just prefer not to deal with PHP 4 any more.
For anyone who’s tempted to lump me in with the GOPHP5 crowd, don’t. My intentions really are not that noble; I honestly have no agenda beyond personal preference.
Alec at FolioVision has discussed not making some plugins PHP 5 compatible, but for different reasons. I would like to think that he’s right, that the number of hosts offering PHP 4 will drop quickly, but I’m not quite so certain.
I don’t recall seeing any other plugins that have a PHP 5 requirement, but that doesn’t mean they aren’t out there. I also recognise that doing it will reduce the potential uptake of anything I do, but I honestly don’t know by how much.
What do you think? Does your host only offer PHP 4? Do you have any strong feelings one way or another? How many plugins would need to be PHP 5 only for you to change hosts?
Comments
Leave a Reply
I am currently testing a comment link policy which means commenters do not get a link. There is a poll, and open comments for feedback on the comment policy page.

1
Adam (http://www.talkphp.com/) commented at 1:21 pm, 4th 01 2008:
It’s a shame that developers are not developing for PHP 5 STILL! There is far more you can do with PHP 5 in terms of the OOP side of the card, and unless people begin switching sometime soon, and shed their fears of compatibility for a 2+ year old version, then just perhaps they’ll find themselves inadequately learned when they finally do.