Chapter 5
Object-Oriented PHP Programming
IN THIS CHAPTER
Defining object-oriented programming
Creating objects
Using objects
Customizing objects
So far, all the PHP scripts presented in this book have followed the procedural style of programming. With procedural programming, you create variables and functions in your code to perform certain procedures, such as storing values in variables, and then check them with conditional statements. The data you use and the functions you create are completely separate entities, with no specific relationship to one another. With object-oriented programming, on the other hand, variables and functions are grouped into common objects that you can use in any program. In this chapter, you learn what object-oriented programming is and how to use it in your web applications.
Understanding the Basics of Object-Oriented Programming
Before you can start working on object-oriented programming (OOP), you need to know how it works. OOP uses a completely different paradigm from coding covered earlier in this book. OOP requires that you think differently ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access