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.