Why is it necessary to drop support for PHP 4?

PHP version 5 adds a number of new features and design changes that make developing robust, secure, feature-rich software faster and easier. Those features do not exist in older versions of PHP 4, however, and many are very hard to emulate. Such features include fast and easy XML support for improved web services, better timezone handling, vastly improved database tools and input tools to make PHP applications more secure, and many others.

Projects that support PHP 4 cannot make use of those newer features, however. That means projects have to choose between supporting PHP 4, which has been in maintenance-only mode for over three years, or enabling modern web applications and services. For a long time many projects have chosen to support PHP 4 because of the large number of web hosts running PHP 4. Unfortunately that has resulted in a "chicken and egg" problem where web hosts have no incentive to upgrade to PHP 5, which means PHP developers can't use PHP 5's new functionality even if they want to.

By announcing that many leading open source projects will drop legacy support for PHP 4 at a fixed later date, we believe we can break that cycle and encourage web hosts to upgrade and allow open source developers to build faster, more secure, more powerful web applications.

My webhost supports PHP 5.2, how can I get them listed?

As of February 5th, 2008, we're declaring our efforts a success and closing submissions for new projects and hosts. The projects and hosts that are already listed helped us get the momentum going and we're grateful to them. As much as we'd like to be able to keep listing new projects and hosts, it is rather labor intensive, and we're busy people. Thank you for supporting GoPHP5.

Why February 5, 2008?

First Quarter of 2008 gives web hosts and open source PHP projects ample time to ensure that they are ready for modern PHP development. By then PHP 5.2 will have been out for over a year and a half as well.

We wanted a date that was soon enough that PHP developers could begin planning for it but sufficiently far away that web hosts had a fair and reasonable amount of time to upgrade their systems. Why that date specifically? Because in European format it is 5/2/2008, so we can target 5.2 on 5/2.

What can I do if my webhost doesn't support PHP 5.2?

The first thing you should do is contact their support representatives and politely ask when they will support PHP 5.2. Many web hosts may have plans to upgrade their systems that they haven't announced yet. If they don't, you can direct them to this web site to show that there is a need to upgrade to modern software versions. Give them some time; most web hosts won't immediately respond but will have to consider how they want to proceed.

If your web host says that they will definitely not be upgrading to PHP 5.2 but you depend on a project that requires it, the best thing you can do is find a new web host that will keep their software up to date.

What is wrong with PHP 5.0 or 5.1?

PHP 5.0.x had a number of problems with stability and performance. Much of the feature set wasn't fully nailed down yet either, and tools such as SPL and PDO didn't work right until PHP 5.1. Many developers and web hosts shied away from PHP 5 because of it's unfortunately rocky beginnings. Fortunately, PHP 5.0 is not very widely used.

PHP 5.1 was much more stable and reliable, but it also had some issues with performance. It's a viable platform, however, and many projects already require it.

PHP 5 has really come into its own with PHP 5.2, however. It adds a number of important features to the core system that we feel are important to target. Most importantly:

  • The Filter extension is a new security component in PHP. Although available as an optional add-on in PHP 5.1, most web hosts did not install it. It is, however, now included by default in PHP 5.2. The filter extension allows developers to read input more safely and securely. That helps make programs more secure, less error prone, and harder to hack.
  • Many sites now use Ajax for much of their functionality, and one of the most popular tools for Ajax is the JSON format. JSON is a way of specifying data that both Javascript in the web browser and PHP or other languages on the server can understand, making writing portable Ajax applications easier. PHP 5.2 includes a fast, native mechanism for reading and writing from JSON, just as it does for XML, which makes writing dynamic rich client applications easier.
  • Faster, more stable, fewer bugs!
What is wrong with PHP 4?

Nothing! Well, nothing for its time. PHP 4 was released in 2000, and last had a serious functional update in 2003. PHP 4 had a number of very nice features that made it one of the dominant web programming languages in the world. Unfortunately it also had a number of shortcomings, many of which have been corrected in PHP 5.

For instance, modern "Web Services" are built on XML. In PHP 4, XML handing is a very slow and difficult process. That makes it harder for developers to support web services in PHP applications. In PHP 5, however, XML processing is fast and easy, allowing web developers to build richer, faster web services applications or features.

PHP 4 also used a completely separate set of functions for every different database that PHP supports. That made supporting multiple databases difficult. It also leaves it up to the developer to always check against "SQL Injection", a method that n'er do wells use to hack a web site. Even the best developer can make a mistake and leave a security hole that an intruder can exploit. PHP 5, however, offers a new, robust database system called PDO that provides a single interface to all of PHP's supported databases and handles protecting against SQL Injection automatically. That makes writing secure applications easier, which in turn keeps web sites safer.

There are various other important features that PHP 4 lacks that PHP 5 supports, such as true object orientation or vastly improved timezone handling. These weren't issues in 2000 when PHP 4 was released, but they are important features now in 2007/2008. PHP 4 has served us well, but it is time to move on.

Do I have to go out of my way to break PHP 4 in my project?

No. The pledge is not to force projects to rewrite everything to try and break PHP 4. It's to focus on PHP 5.2 compatibility and not worry about earlier versions.

For instance, if you're going to be using objects then don't worry about PHP 4's object semantics. Just assume PHP 5's. If your project doesn't use objects, however, that's fine.

If you want to use one of the newer functions in PHP 5 that is possible to re-implement yourself, don't do so. Just assume that it will be there because you assume the presence of PHP 5. If you don't need them, though, don't use them.

If you're going to be parsing XML, use SimpleXML or the DOM routines. Don't worry about trying to make them work with PHP 4's primitive XML handling. But if you don't need to use XML, don't.

The goal is not to force projects or developers to write code a certain way. It's to enable developers to use newer, more-powerful tools without worrying about 7 year old software. Which tools make the most sense is up to you.