CodeIgniter will not be dropping support for PHP 4 anytime soon
There’s been renewed discussion about CodeIgniter moving to a PHP 5 only framework within the community. This post is my attempt to articulate the point of view of the development team, and my personal reasons for why we will not go this route.
First of all, let me just say this “I like PHP 5”. A lot. I use it exclusively for my personal development, and I want to see it adopted more. I don’t like PHP 4 much, and in fact, I’d love to not need to support it. But the fact of the matter is that the vast majority of PHP servers out there are still running PHP 4, and we want our products to be accessible for the widest possible audience. We will not be dropping support for PHP 4 anytime soon.
To know why, one need only look at recent PHP Usage Statistics. Here’s December:
I won’t bother with the graph, but here’s six months ago in June 2007.
Let’s put this into perspective. The PHP 4 end of life announcement was made in July 2007. And since July, PHP 5 has gained about 7% of market share (8% since June) and it seems like that growth is still hovering a little over 1% a month. I am looking forward to seeing the results for January, since December was the last month for PHP 4 support, according to PHP.net, but I doubt it will make much difference.
At the current rate of adoption, we might be able to switch over CodeIgniter to PHP 5 only some time in August 2010, assuming we would require >70% PHP 5.x usage and 8% adoption every six months. I don’t even want to think about PHP 6.
So what are our plans for PHP 4 support? We make software for the real world. I assure you that when PHP 4 becomes as irrelevant as PHP 3, that we’ll drop support for PHP 4. That said, most of the areas where speed would matter we have pulled out anyhow. There’s some smart coding going on. If you check system/codeigniter/ you’ll see base4 and base5 for handling the super-object. base4 gets loaded on (wait for it) PHP 4 systems, and base5 on PHP 5, so much is already nicely separated. In truth, if you do your own programming in PHP 5, there is little to gain practically.
The fact is, PHP 4 still works great for the majority of things, and if you have PHP 5, then there is no reason you can’t leverage it. That is what I’ve done with BambooInvoice. It simply won’t work on PHP 4, and there are lots of PHP 5 only magic things going on in there… but at the core, its still built on CodeIgniter, thus reinfocing my point that you can build PHP 5 apps in CodeIgniter without much loss.
CodeIgniter is about getting things done in the real world of deadlines, shared hosts, crazy clients and uncontrolled environments. When that means PHP 5, then I assure you that CI will drop PHP 4 support, and adopt full PHP 5, or 6 or 7 as is warranted. Hopefully my flying car will be out of the shop by then so that I can have my robot butler prepare my food-pill a bit early that day and I can pick it up.
Edit: Stats from http://www.nexen.net. Here is their full December PHP adoption article for your perusal. Much more interesting information in there.
Edit (March 9, 2008): A commenter has requested to have their comments removed, and I’ve done so, so some of the comments may seem out of context.



Chris wrote on
Totally agree with the thinking behind this, especially ‘we make software for the real world” - I would LOVE to be writing just PHP5 but I’ve found in the real world a lot of clients have existing hosting arrangements and they’re not willing to change them and those hosts still use PHP4. Is it annoying? Hell yes, but I’m SO grateful that Codeigniter still supports it so I can still use super-fast MVC goodyness! Thanks Derek!!
PS - I think paragraph 2 sentence 3 might have typo - ‘I don’t like PHP much’, think you might have missed a ‘4’ outta that ;o)