What Was Wrong with PHP 4?
Alright, so those aren't very professional-sounding reasons, but they represent the bottom line: If a technology meets your needs, how can it be bad? The answer is, it's notat least not for me. But if you come to PHP from other programming languages, especially highly structured, specifically object-oriented languages, the crossover to a flexible, procedural language that just happens to handle object-oriented programming can be frustrating. Of course, the ease of use and somewhat hidden robustness is one of the reasons new programmers are drawn to PHP in the first placethe learning curve isn't steep, and it gets the job done.
However, this also presents a marketing and positioning problem for PHP within the enterprise. Some Powers That Be may not think PHP is suitable for enterprise-level application development, because it is not a time-tested, structured, object-oriented programming language such as C++ or even Java. There may not be the time or opportunity for a developer to convince her managers otherwise by showing examples of PHP and C or Java performing the same tasksif you even can, with the same level of structure, security, reusability, and exception-handling. From these and other problems came the development path for PHP 5, the main purpose of which was to improve the object model, instill a sense of programming discipline, and specifically design a version of PHP that meets the needs of object-oriented developers and allows them to interface with Java, .NET, and other enterprise-level application frameworks.
But where does that leave Joe and Jane Developer, who don't want anything to do with objects, classes, .NET, or XMLwho just want a simple, fast, flexible language they can use to create basic, dynamic Web sites? These developers are not left out in the cold. While PHP 5 contains an enhanced internal scripting engine and a vastly improved object-oriented framework, the PHP Group and Zend Technologies recognizes and appreciates the roots of PHP and the core group of users who have made it so pervasive.
As with PHP 4, PHP 5 does not force you to use the elements of the language you don't wish to use. If your applications are written at the basic, procedural level introduced in this book, and that works fine for you, you don't have to change a thing. If you want to enjoy the benefits of object-oriented programming, you should read the overview of object-related enhancements in the next section and see how they may impact your applications, before installing and using PHP 5.