|
Chapter 9
Object-Oriented Programming
Meets PHP
In This Chapter
Understanding object-oriented programming
Identifying objects
Writing classes
Using classes
P
HP began life as a simple set of scripts. Over the course of its life, PHP
has added some object-oriented programming features, and object-
oriented programming became possible with PHP 4. With the introduction of
PHP 5, the PHP developers have really beefed up the object-oriented features
of PHP, resulting in both more speed and added features. Much of this
improvement is invisible — changes introduced with the Zend 2 engine that
powers PHP 5, that make scripts using objects run much faster and more
efficiently than they did in PHP 4. In addition, to speeding up scripts, object-
oriented functionality has been added to PHP that object-oriented program-
mers have been waiting for.
Introducing Object-Oriented
Programming
Object-oriented programming is an approach to programming that uses objects
and classes, which are discussed in more detail later in this chapter. Object-
oriented programming is widespread today, and many universities teach
object-oriented programming in beginning programming classes. Currently,
Java and C++ are the most prevalent languages used for object-oriented
programming.
|