Intermediate PHP

Builds upon the foundation principles of PHP, and now follows on into the concept of Object Oriented Programming within PHP.

 

It is assumed that you will already have a good understanding of the general OOP ideas and techniques, and the following material will therefore not go into the theory behind OOP but will focus upon how it is implemented within PHP.

 

Some of the more advanced techniques in PHP will be presented after the OO PHP articles.

class

The keyword class is used to define a user defined (abstract) data type. It is then followed by the user defined class name (/identifier) and a pair of curly braces { }

e.g class className { }

 

As you can see the above is not too useful on its own and this is because classes usually contain class members, consisting of attributes (/properties) and behaviours (/methods).