Chapter 2. PHP5 OOP

When you begin a new project, one of the first things you have to consider is the structure of your code. Whether you're coding something as simple as an online contact form, or as complex as a full-featured content management system, how you organize your code is going to influence the performance and maintainability of the end product.

When you use a language like PHP, there are two main routes you can go: procedural programming and object-oriented programming—OOP for short. Each strategy has its own benefits and limitations.

Get Professional LAMP: Linux®, Apache, MySQL®, and PHP5 Web Development 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.