In this chapter we will learn how to create objects, define their attributes (or properties) and methods. Objects in PHP are always created using a "class" keyword. In this chapter we will learn the details of classes, properties, and methods. We will also learn the scope of methods and about modifiers and the benefits of using interfaces This chapter will also introduce us to other basic OOP features in PHP. As a whole, this chapter is one of the better resources for you to kick-start OOP in PHP.
As I said before, you can create an object in PHP using the
class keyword. A class consists of some properties and methods, either public or private. Let's take the
Emailer class that we have seen in ...