Introduction :

Since the introduction of PHP 5 in 2004, PHP has had an object model worthy of that description and became a truly modern language for use on the web. Earlier PHP scripts would have been of the kind where you would "Begin at the beginning, and go on till you come to the end: then stop."

Using OOP (Object Orientated Programming) enables us to architect our systems much more clearly, and to make them more manageable and more maintainable. This technique also allows us to separate form from function to create clean, navigable codebases with plenty of opportunities to reuse code, apply design patterns and bring in concepts from other brances of computer science.

In OOPs programming model, programs are developed around objects and data rather than actions and logics.

Class: A class defines the properties and behavior (variables and methods) that is shared by all its objects.

Object: Object is the basic entity of object oriented programming language. Class itself does nothing but the real functionality is achieved through their objects. Object is an instance of the class. It takes the properties (variables) and uses the behavior (methods) defined in the class.

The most powerful features of OOPS commonly used are

Encapsulation :

Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. The wrapping up of data and methods into a single unit (called class) is known as encapsulation. The benefit of encapsulating is that it performs the task inside without making you worry. Click Here for details

Inheritance :

Inheritance is the mechanism of deriving a new class from an existing class. It allows a sub-class/child class to share/inherit the attributes and behaviors of a base-class or parent class.
These inherited attributes and behaviors are usually modified by means of extension. To inherit in PHP5, you should use the keyword 'extends' in the class definition.Click Here for details
Note : In PHP5 only single inheritance is allowed.

Polymorphism :

Polymorphism is derived from two Greek words. Poly (meaning many) and morph (meaning forms). Polymorphism means many forms. The meaning with Object Oriented languages changes.
With Object Oriented language polymorphism happens: When the decision to invoke a function call is made by inspecting the object at runtime it is called Polymorphism.Click Here for details

Interface :

An interface is a contract between unrelated objects to perform a common function on the fly. An interface enables you to specify that an object is capable of performing a certain function, but it does not necessarily tell you how the object does so, this means that it leaves for classes implementing an interface to define its behaviour. It's basically knows as dynamic binding , meaning the class which implements the interface provides the body dynamically . To use an Interface, keyword 'implements' is used.Click Here for details
Note : We can have a class extend from only one class but can use (implement) more than one Interface.