ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾PHP ±à³Ì£¾PHP 5 Power programming
Team LiB
Previous Section Next Section

3.1. Introduction

PHP 3 is the version that introduced support for object-oriented programming (OOP). Although useable, the support was extremely simplistic and not very much improved upon with the release of PHP 4, where backward compatibility was the main concern. Because of popular demand for improved OOP support, the entire object model was completely redesigned for PHP 5, adding a large amount of features and changing the behavior of the base "object" itself.

If you are new to PHP, this chapter covers the object-oriented model. Even if you are familiar with PHP 4, you should read it because almost everything about OOP has changed with PHP 5.

When you finish reading this chapter, you will have learned

  • The basics of the OO model

  • Object creation and life-time, and how it is controlled

  • The three main access restriction keywords (public, protected, and private)

  • The benefits of using class inheritance

  • Tips for successful exception handling

    Team LiB
    Previous Section Next Section