6. Basic Object-Oriented Programming

Object-oriented programming (commonly abbreviated OOP) is a relative newcomer to the world of programming. Before the advent of OOP, languages such as Pascal and BASIC solved problems through linear programming. As projects get bigger, perhaps requiring teams of developers, this approach becomes too time-consuming and error-prone. Hence OOP, which allows programmers to more rapidly develop, use, and manage sophisticated applications.

Similarly, OOP is quite new to PHP. Version 3 of the language had rudimentary support, and version 4 made some nice improvements on this front. It’s in PHP 5 that OOP support has become closer to what true OOP languages, like Java and C#, offer. Although PHP is still not as strong ...

Get PHP 5 Advanced: Visual QuickPro Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.