Chapter 1. Introduction
PHP 4 is a wildly popular web programming language. Web servers on over 15,000,000 domains support PHP. PHP is the most popular Apache module by almost a 2-to-1 margin. But if PHP’s so great, why do we need PHP 5?
Well, PHP 4 isn’t perfect. While it makes developing web applications quick and easy, it’s occasionally weighted down by its legacy baggage. This makes tackling some problems unnecessarily difficult.
In particular, PHP’s version of object-oriented programming (OOP) lacks many features, the MySQL extension doesn’t support the new MySQL 4.1 client protocol, and XML support is a hodgepodge.
Fortunately, PHP 5 improves on PHP 4 in three major areas:
Object-oriented programming
MySQL
XML
These items have all been completely rewritten, turning them from limitations into star attractions. While these changes alone warrant a new version of PHP, PHP 5 also provides:
SQLite for an embedded database
Iterators
Error handling using exceptions
Streams
SOAP
Some of these features, such as iterators and exceptions, are available only due to fundamental changes in PHP’s core. Others, such as streams and SQLite, are PHP 4.3 features that have matured into prime-time use in PHP 5.
This book shows you how to take advantage of these new features in your applications. Additionally, it places a special emphasis on not just telling you what’s new, but showing you how and why it’s new.
Whenever possible, there’s a direct comparison between the PHP 4 method of solving a task and the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access