RSS

Is PHP4 worth it any more?

Mon, Jul 7, 2008

Decisions, PHP

A week or so ago, I posed a question on Twitter:

If you were going to build a PHP application for use by others, would you even bother making it PHP4 compatible any more?

Responses were - with one exception - unanimous, with most people citing hosting as a key reason. Rachel Andrew, edgeofmyseat:

PHP5 all the way … more apps that require PHP5 means more people asking for PHP5 on shared hosting.

Jon Gibbins agreed:

Not worth the effort now I think. I suspect many hosting services to be upgrading now that PHP 4 is end of life.

And Simon Jones, studio24:

Encourage people to look forward not back.

CodeIgniter and PHP5

While there are a fair few PHP frameworks that only run on PHP5, CodeIgniter is not one of them - in fact, the only minor benefit one can obtain from using PHP5 is that it allows you to chain methods together when using its Active Record class:

$result = $this->db->select('id, name')->from('mytable')->where('name', 'Bob')->get();

So no real benefit to be gained in that respect. What PHP5 does offer, though, is many new functions, a completely new object model, and various other cool things.

At the moment I’m leaning heavily in favour of going with PHP5 - as someone else noted, it’s going to be much easier to port code from PHP5 to PHP6, than from 4 to 6 - but I’m still open to persuasion if anyone thinks differently.

, , , ,

This post was written by:

Matthew Pennell - who has written 11 posts on Add It Up Development Blog.

Writer, designer, programmer, renaissance geek.

Contact the author

3 Comments For This Post

  1. Derek Allard Says:

    For building an application, I’d strongly favour PHP5 only if you get to control the hosting (ie: you aren’t selling a distributed app). For framework development though, I think its too early for CI and Cake to abandon PHP4. Yes we hate it, yes it sucks, but it still represents 60% of the PHP market available at this time - since the PHP end of life announcement [em]a year ago[/em] that has dropped 15%. If we assume that decline will hold (I doubt it will, but let’s pretend) then I think we’ll be ready to abandon PHP4 in about 2 more years. ;)

  2. Phil Thompson Says:

    My heart says goes with PHP5 but my (business) brain says go with PHP4.

    The trouble is that you’re limiting your potential market by rejecting PHP4 - don’t get me wrong I’ve just released a web app that is PHP5 only and plan another soon but deep down I know it’s a small mistake to only support PH5.

    Sadly a lot of web hosts only support PHP4 at all or PHP5 in a strange way - e.g. with 1and1 (a huge hosting supplier) you have to add a line to your .htaccess file that is beyond the scope of most small time website owners (e.g. 1and1’s customer base)

  3. Jon Gibbins Says:

    Chris Shiflett has an interesting post about PHP 4 and its end of life:
    http://shiflett.org/blog/2008/aug/end-of-life-for-php-4

Leave a Reply