In this chapter , we’ll be taking a look at object oriented programming, or OOP .
Whether you’ve used OOP before in PHP or not, this chapter will show you what
it is, how it’ s used, and why you might want to use objects rather than plain functions
and variables. We’ll cover everything from the “this is how you make an object”
basics through to interfaces, exceptions, and magic methods. The object oriented
approach is more conceptual than technical—although there are some long words
used that we’ll define and demystify as we go!...
If you’re ever writing code and get the funny feeling that you’ve solved the
problem you’re working on before, you probably have. You may well have
come across the same type of situation in the past, puzzled about it, and
come up with the solution. And before that, you may have faced the same
type of situation and come up with the same type of solution. And even
before that . . . same thing.
In this chapter, we will:...