Why not PHP 5?
I’m really shocked by this. According to the latest Nexen.net PHP Version Survey, over 80% of the sites out there running PHP are running some flavor of PHP 4.
Why?
For those of you who missed it, PHP 5 was released almost THREE YEARS AGO. That’s right … in a couple months, we’ll celebrate the 3 year anniversary of PHP 5.0.0 stable’s release.
I am fully aware that there are a handful of compatibility issues between PHP 4 and PHP 5 (outlined here). I was bitten by a few of those myself when I first started porting code over to PHP 5, but none of them were major issues.
So, PHP 4-using majority: what’s keeping you?
Is it your ISP that is behind the times? Your company’s system administrator? Your dependency on slow-to-upgrade libraries or applications? Or something else?
Please post the reason you haven’t upgraded yet in the comments below. I’d very much like to know what the resistance is to PHP 5.
Original Post Comments
On Monday, February 12th, 2007 at 1:14 pm, Jan said:
We run a large and messy application on PHP 4 and we just don’t have the resources to a) see if everything works in PHP 5 b) re-engineer everything. And c) we don’t really want to upgrade and see what happens.
Our customers would gain exactly nothing from the transition and we’d rather spend time improving their experience and there is nothing where PHP 5 could possibly help here.
We are, though, already refactoring code on a needs-an-update basis and try to be more future proof, but this takes time.
That said. We (and I) don’t have anything against PHP 5 and new applications usually get the pentium-treatment, but there are reasons where it’s just not worth it.
On Monday, February 12th, 2007 at 1:15 pm, mg said:
Fucking stupid management.
We have bunch of root servers, i can administer myself running the latest PHP 5.2.1 from dotdeb.org.
But we also got some managed servers where i’m sometimes forced to code or grap in a bunch of crap code done by PHP newbies. So, would you really like to upgrade them?!
Anyway, i don’t care for spam or security issues. We have backups, and if something goes wrong we can fix it. If we can’t handle the work in one day, the customer has to wait till the problem is fixed. So, that’s really easy…
Yep, ISPs don’t update on regular basis. The bigger they are the lazier they are. But our ISPe big, und the management wants to best. The best is the biggest - for sure?!
Anyway, i can’t wait till register_globals is gone forever with PHP6
On Monday, February 12th, 2007 at 1:53 pm, Jess said:
I’m guessing CMS’s like PHP-Nuke factor in a lot. PHP-Nuke is extremely popular, but doesn’t work on PHP5. So I manage a domain that is currently stuck at PHP4 due to its use of PHP-Nuke.
As an aside, if I’d known the development ‘philosophy’ (ie, cowboy all the way) of PHP-Nuke upfront, I would have looked elsewhere.
On Monday, February 12th, 2007 at 1:59 pm, Evert said:
If you would have statistics on new applications being built on php5 vs. php4 I would bet php5 would outnumber 4 by far..
The only exception to that would be the people who go with the default for debian or os/x.. (sure there are more distro’s which only supply php4)
On Monday, February 12th, 2007 at 2:10 pm, Clay said:
@Jan: Would an easy way to run PHP lint-checking of your codebase against PHP 5 help?
@MG: Good point. However, there’s really no reason that PHP newbies should NOT be learning PHP 5 out of the gate.
@Jess: Ahh, php-nuke. Surely there’s an upgrade path for people who want to get away from that drivel that is more forward looking? I don’t know, haven’t looked at the various nukes in several years.
@Evert: You would be surprised. I have run across companies who were not even founded until 1-2 years AFTER PHP 5 was released who built their initial applications in PHP 4. I think there’s so much lingering FUD about the switch to PHP 5 from PHP 4 that a lot of developers (especially those who are pressed for time) just stick with what they know.
On Monday, February 12th, 2007 at 3:13 pm, Pádraic Brady said:
Unfortunately there are still tons of legacy applications whose developers have absolutely zero inclination to undergo some PHP5 migration work - as minimal as it may be. For that reason alone ISPs just have a huge incentive to continue PHP4 support given their user bases (few of which are PHP developers or even beginners).
Personally I got around to dumping PHP4 as a development platform about a year ago. I had two years where I had little choice given a large installed base of PHP4 apps - but eventually they either migrated (kudos) or were replaced.
90% of my development time is now primarily PHP5 (lovin’ it! - don’t sue me MaDonalds!) with a smattering of PHP4 code which is kept portable to PHP5 and mainly because its a) open source and b) therefore only broadly useful if it works under PHP4.
I believe the term is called a “vicious circle”. Large PHP4 install base means more applications needing to run under PHP4 means less incentive for Hosts to move to PHP5 which lands us back to the starting point :(.
On Monday, February 12th, 2007 at 3:13 pm, Yann said:
The reaons is simple.
We just migrated from php 4.1.2 to php 4.4.4. The code is realy messy and we are starting to clean things up. Once everything is clean we will migrate to PHP.
PHP4 Works really well and answers most of our needs. So why change ?
On Monday, February 12th, 2007 at 4:20 pm, Mikey said:
Well, you say PHP 5.0.0 stable release - I argue against this and say that PHP 5 has become stable with PHP 5.2.0 and not any version earlier. There was too much hassle between minor versions of PHP 5.0.x and PHP 5.1.x that lead me to many “WTF” moments when upgrading from one version to another and finding out that my PHP5 code has to be changed once again to work with the new version.
I’m working for 1&1 in Germany, we offer PHP5 to our hosting customers since September 2004, currently version 5.2.0.
For our own websites and internal applications we still stick with PHP 4.3. Main reasons for this are our large code base (thousands of existing classes), the lack of time for migration due to more important business stuff and the aforementioned status of PHP 5. First new applications in PHP 5 are developed since early 2006, existing code base for internal tools has been migrated in the last weeks, and external applications will follow later this year based on a new PHP 5.2.0 based framework currently being developed by my department due to the reason that our old code base for external applications became somewhat messy with the years.
On Monday, February 12th, 2007 at 4:40 pm, Stu said:
ISP hasn’t upgraded yet; simple as that. We could look for an ISP who offers PHP5 but there’s no compelling reason as none of our established software uses any of the new features (because it was developed on PHP4), we’ve got an established relationship with our current ISP, and I don’t fancy doing another migration. We’ll get there eventually, unless our ISP skips PHP5 and just goes straight to PHP6.
On Monday, February 12th, 2007 at 8:04 pm, Anonymous said:
If I gained all the performance PHP5.2 offers over PHP4, I wouldn’t be able to justify keeping so many servers online.
I don’t care about OOP. Really, objects hold no sway over me. On the occasions when I do want to use them, I certainly do want them to be useful or exhibit behavior which makes sense.
I’m hoping PHP4 support will finally be dropped completely so that when new bugs in the runtime are discovered, I can make excuses for the attacks which succeed.
Trying out PHP5 on a spare machine to see if my application works would be too tempting, I might want to actually complete the upgrade if my irrational fears were assuaged!
I don’t think my ISP should have to lose clients just for refusing to design a migration plan for their paying customers. My fees are putting food on someone’s table. Do you want little Johnny to starve? THINK OF THE CHILDREN! I’m going to stand up and protect little Bobby-Sue by staying right where I am, even if that means using PHP4.
XML is all hype, I don’t need a fast, robust API for processing data from external systems, that’s why CSV is for!
My friend told me it gives you Herpes.
On Monday, February 12th, 2007 at 11:26 pm, Webbles said:
I agree with Jan. We have a large application on PHP 4 and there isn’t an easy way to test that PHP5 won’t break the code. The object change (pass by reference instead of copy) scares the program managers as well as some of them having E_STRICT turned on when they did a preliminary test. Currently we don’t have the manpower to check the entire source code to make sure everything runs correctly on PHP5.
On Monday, February 12th, 2007 at 11:43 pm, Martin said:
“We run a large and messy application on PHP 4″.. we too, and not only one. The bad thing is that new developments here are being build with php 4 too. Makes me sad.. lazy admins, maybe lazy developers, and the management.. There are so many small things that block the way for php5. And in the end, I can’t do much about it - I’m a regular web developer in this organization, nobody’s listening Me - I do my own stuff with php 5 since 2 years, but what can I do in a relatively large company? Any suggestions are very appreciated!
On Monday, February 12th, 2007 at 11:52 pm, Dagfinn Reiersøl said:
One simplistic answer might be “for the same reason Cobol is still in use”.
On Tuesday, February 13th, 2007 at 12:26 am, Ivo Jansch said:
Every once in a while this discussion resurfaces See a summary of the last time here on my blog:
http://www.achievo.org/blog/archives/52-PHP5-adoption-a-summary.html
On Tuesday, February 13th, 2007 at 12:27 am, stefan said:
I have been wondering about this on multiple occasions as well:
- http://www.leftontheweb.com/article/302/php5-adoption
- http://www.leftontheweb.com/article/309/another-proof-of-little-php5-adoption
- http://www.leftontheweb.com/article/313/the-adoption-of-php-6
It’s scary, because (this is my experience) most php4 code is crap compared to php5, simply because php5 allows for better coding and also because a lot of php5 tutorials and articles go more into actual programming theory than at the time php4 was the “main thing”.
On Tuesday, February 13th, 2007 at 2:48 am, Rich Buggy said:
At work we’re stuck with PHP 4 because our content management system doesn’t work with PHP 5. The company behind it says it will take another 18 months before they’re ready to release a PHP 5 compatible version.
On Tuesday, February 13th, 2007 at 2:55 am, Jan said:
“@Jan: Would an easy way to run PHP lint-checking of your codebase against PHP 5 help?”
How so? We’re certainly not concerned about parse errors, our customers would tell us about them really fast Also: for file in
find . -name *.php; do php -l $file; doneNo, the problems here are subtle bugs and inconsistencies that don’t surface when you do lint-checking or unit-testing.
We’re fully aware that this is some of the worst engineering practice we’re doing. But for now it has been very profitable and it doesn’t look like this is changing anytime soon. Still, we’re continuing to work on a better code-base. Again, it just takes time.
On Tuesday, February 13th, 2007 at 3:10 am, boots said:
Honestly, IMO 5.1 was the first “good” release of PHP while 5.1.4 was the first really usable and trustworthy release. 5.2.1 seems like the first viable release that could stake a claim to not just overall improvement but also offer some real long-term developer stability in terms of life-cycle that PHP 4.3 (and later 4.4) developers have come to depend on. That said, it is not available yet in trusted distros such as Deb. That is an important factor, IMHO.
Sure, PHP5 is the way to go from here out — but I say let us not lament just yet the maintenance of good ‘ol PHP4 apps: despite all of the improvements in PHP5, those cranky PHP4 codes are still our bread-and-butter — and for good reason. The “real” PHP 5 has only recently emerged as a stable and dependable platform. It will win but its timeline starts now, not three years ago.
Very best regards.
On Tuesday, February 13th, 2007 at 5:05 am, Rik said:
I would love to move to PHP5 but my host won’t upgrade. Time to move to a new host.
On Tuesday, February 13th, 2007 at 4:03 pm, terry chay said:
Is this such a big deal?
I’ve used PHP 5 in production environments since it was beta (yes, beta), but now I work at a company that is PHP 4 and migration is not a snap: we have millions of users spread across over a hundred machines in an environment that works and there are not enough reliable acceptance tests to make this simply flipping a switch somewhere.
Migration is easy when you have provable large performance, development or feature gains. PHP 5 doesn’t do that for some of us. It honestly doesn’t. Assuming we get the bugs worked out, we could maybe improve the efficiency of our site by 20% with the improved object model and the availability of extensions for xml parsing, JSON, and memcache. Maybe if our site used XML more…
Those of us old enough to remember the PHP 3 to PHP 4 migration remember that it took a very long time (I switched our commercial site from PHP 4 at the end of 2000, but most sites were using PHP 3 for years afterward) and unlike PHP4, that offered real performance gains (Zend Engine vs. run-time) and features (object orientation, more extensions, etc.) with less compatibility headaches at a time when sites weren’t making tens of thousands to millions of dollars a day.
So migration for us will be tough and will involve me working extra hours in my spare time. I’m down with that. There are bigger rocks for to deal with during the day.
PHP 6 has the right idea: break backward compatibility and those who need features like i18n, APC, etc. will do the work to upgrade. The rest of the world can use PHP 5 or even 4.
And from that perspective, migrating to PHP 5 from PHP 4 makes a baby step to PHP 6.
-terry
On Wednesday, February 14th, 2007 at 3:10 am, Gaetano Giunta said:
All of those have already been reported, here’s my take in order of importance
- Dog-bytes-tails problem:
ISP does not upgrade
coder of shrinkwrap php sw needs to still cater to users stuck on old platform
ISP is not compelled to upgrade since apps keep running on php4
etc..
php 5 was not really stable until 5.1.X (and not the first point releases). Plus minor api changes in-between 5.X
way too many small changes not really necessary but impacting your code (eg. making var deprecated instead of assimilating it to public, deprecating is_a, functions returning class/function names now respect case, curlinfo spits array instead of string, etc…)
not really huge gains for existing codebases (which will probably make usage of php libraries for doing json, xmlrpc, soap and the like)
On Friday, February 16th, 2007 at 6:00 am, Michael Kimsal said:
Terry, one other thing you might remember from the PHP3->PHP4 migration days is that you could run both as Apache modules in the same Apache server. In my view, this is the biggest thing holding back PHP4->PHP5 adoption. And since it’s been nearly 3 years and there hasn’t been a way to make it happen yet, it doesn’t seem to be high on anyone’s priority list to change that roadblock. I wrote a bit more about it at my blog, but that to me is the biggest stumbling block to widespread PHP5 adoption.
On Tuesday, May 1st, 2007 at 12:12 pm, Steven Birch said:
Some distros, say Redhat Enterprise, which caters to the stable and support needs of enterprise and many hosting providers clients, did not have an official release of php 5 and mySQL 5 until the recently released Redhat Enterprise v5. Seeing as how RHEL and CentOS are quite popular and ship with php 4.3.x and MySQL 4.1.x with security and bug backports it makes sense why many have not upgraded. You realize there are a measurable number of php 4.1.x and MySQL 3.x users still in the world too right? Why would you not upgrade to MySQL 4 or 5 yet? same question.
Then again I know a lot of users still running Windows 2k instead of XP (much less Vista) or OS X 10.2.x or 10.3.x though 10.4.x has been out for quite some time…
This can go on and on… why are the officially supported versions of apache for control panels like cPanel for hosting companies still based on apache 1.3.x code, and usually ship as well with php 4.x? In many cases the reason hosting companies have not upgraded many of these is simply the control panel companies so many base their management on are behind the times as well…
Not always an issue with the hosting companies or IT staff, it simply could be the selection of OS or management products that are still shipping older versions for stability or unknown reasons as well. Always easy to say “why don’t you” if you don’t manage 100’s or 1,000’s of servers, and 10’s or hundreds of thousands of clients accounts … breaking a single user is an oops if they are running older code, forcing 10’s or 100’s of thousands of users to possible break their web sites all at once if they are running code that does not work on php 5 is a great way to go out of business
On Saturday, June 30th, 2007 at 6:17 am, Tom said:
Ok, I have an entire development team started on PHP 4.3; I have a client who wants latest and greatest version of PHP. I am stuck in middle, what would be your call?
On Saturday, June 30th, 2007 at 6:36 am, Clay said:
Tom,
I suggest switching your project to PHP 5 now. There are only a handful of actual, code-breaking incompatibilities between PHP 4 and PHP 5 — you do not have to write in E_STRICT-compliance to get code running on PHP 5.
Switch now, troubleshoot the little things like array_merge() usage and the other things described here:
http://www.php.net/manual/en/migration5.incompatible.php
… and don’t look back.
On Monday, July 23rd, 2007 at 9:53 am, games said:
Why bother upgrading? Our customers won’t benefit, and therefore we don’t benefit. Things are working fine now – as they say, “if it ain’t broke, don’t fix it.”
Sorry for the cliché, but it’s the truth here. However, when we need to do some extra coding or whatever, we generally then rather do it in PHP 5 – but the old stuff can stay as it is, it’s working fine.
Obviously, I’m all for upgrading etc. and development, but here it’s just not really worth it right now.
On Monday, July 23rd, 2007 at 10:09 am, Clay said:
@GAMES .. “Obviously, I’m all for upgrading etc. and development…”
Oh, obviously. The performance improvements in PHP 5 are well documented. If you feel like you and your customers wouldn’t benefit from that, perhaps you need to rethink the service business?