The future of PHP

Jurriën Stutterheim posted an interesting article on the future of PHP recently (“PHP… what to say?”). In it he argues that PHP shouldn’t try to maintain complete backwards compatibility in the next release, saying,

“PHP 6 will make or break PHP as a language. For PHP to make it, it needs a clear vision of what it wants to be. Trying to maintain compatibility with ancient and mostly poorly written scripts can’t be part of this vision.”

The language can’t advance, he says, if it’s chained to outdated yet popular open-source projects.

But here’s the problem. If you’re intent on being the lingua franca of the Web, backwards compatibility is critical. It’s part of that compatibility-stability-security triumvirate that users love.

You see this conflict elsewhere in the tech industry. Microsoft’s greatest strength and biggest weakness is backwards compatibility. Users love it because decade-old programs still run in Windows. If you’re, say, a medical transcription company that uses an application written in the late ’90s, your company is going to stay with Windows indefinitely, because no external factor forces you to update that application. And Microsoft isn’t going to do anything to jeopardize that.

This is the same wall that PHP is headed toward. I view it as a wall. Others might not; it’s certainly not a bad place to be at the moment. On the plus side, it means PHP developers have more opportunities afforded to them because of the popularity of the language. The downside is that they can look left and right and see niche languages innovating in compelling ways. The more “cosmopolitan” PHP programmers inevitably develop language envy and move on, but these are exactly the kind of developers PHP should fight to retain.

It doesn’t have to be this way. PHP could flourish as a smaller language. This is the tack that Apple has taken, and it seems to work well for the company and its users. Apple is one of the most innovative companies in the entire tech industry owing in no small part to this strategy.

For my part, I’d like to see first-class functions and closures included in the language. An object-oriented API ($file->read(1024)) alongside the procedural functions (fread($resource, 1024)) would also be welcome.

But none of that will happen, because PHP is a language in decline. Not a decline in usage—it will only continue to expand its reach—but in the addition of innovative features from other languages. There will be no need to evolve; most of the agitators for change will have moved on.

There is one hope for PHP, however: Zend Framework. I think if it can gain a foothold among developers, some of these trends can be reversed. Hopefully (for PHP) everyone hasn’t moved on to Ruby by then.

Like this post? You might also like Coalmine, my centralized error tracking service for your apps. Coalmine captures errors and all kinds of helpful debugging information, notifies you, and makes it all searchable. Check it out!

Tags: ,

9 comments

  1. It really sounds to me what needs to happen is a complete end of life fork to happen. The “old” PHP will continue to live on as PHP5, receive basic security updates, etc. And then the “fork” will be born at PHP6. Allow the old, antiquated open-source projects to live on with PHP5 which is complete enough for those projects and then require anyone that wants to move on and use a more fashionable language with the features you would like to see and more to migrate to PHP6. With this fork, you can remove a lot of the junk, standardize method names, etc.

  2. PHP5 already had some minor BC issues… at least I’ve heard some hosting people etc. say they won’t update to 5 because their client’s apps would break and so on…

    Personally I don’t see any problems whichever way PHP is gonna go. It’s still going to be the same nice language. Of course, there are other languages with more niceties etc. but PHP still has its simple charm =)

    And there’s always pooQuery if you like OOP interfaces ;)

  3. Hi Matt,

    Interesting analysis, although I don’t entirely agree with you. IMO you decide the future of PHP, if you stop supporting it or stop contributing to the project, then yes, other will look for alternative solutions. PHP is very competitive when it comes to Web development, not only because it has a great object model, but also one of the most powerful frameworks ever created. So, for me PHP is not trying to catch up, it’s waiting for others to catch up, and that might be because of its popularity. Don’t forget that the PHP community reacts very fast to changes and new challenges, ZF is a great example of this, so expect to see much more in the coming years. Contributions, applications, libraries, quality code and even blog posts are more than welcome. It’s up to us to make it happen.

  4. > An object-oriented API ($file->read(1024)) alongside the procedural
    > functions (fread($resource, 1024)) would also be welcome.

    http://www.php.net/~helly/php/ext/spl/classSplFileObject.html

  5. That was an example, Nico. :-)

  6. Since php runs on allmost any server out there, the move to another language will take a while…
    however some wishes i had for the next version are:
    true thread-safety
    strong typing
    cleanup of unused function

    best regards

    nfo

  7. Application programming is different from web programming. Applications have a longer life time so the systems that run them have to be backwards compatible for a longer time, PHP can afford to be a bit less BC.

  8. Unbelievably user pleasant website. Immense details offered on couple of clicks

Leave a comment