16. An OOP Primer

PHP is somewhat unusual as a language in that it can be used both procedurally, as most of this book demonstrates, and as an object-oriented programming (OOP) language. There are merits to both approaches, and you ought to be familiar with each (in due time, at least).

Unfortunately, mastery of OOP requires lots of time and information: my PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (Peachpit Press) spends 200 pages on the subject! Still, one of the great things about OOP is that you can use it without fully knowing it. You’ll see what this means shortly.

This chapter is a primer for OOP in PHP. Some of the ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Fifth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.