So far, you have been using PHP for simple top-down scripting.
In this chapter, you will learn how to declare and use classes and functions (including class definitions, visibility, inheritance, and traits). Also, object-oriented programming (OOP) will be introduced and explained.
The real power of PHP comes with the ability to declare and use classes and functions. As a quick overview, classes are (as you saw in the last chapter) definitions for objects to use when being created. The class definitions then turn into ...