- OOP's stands for
Object Oriented Programming
- PHP is not an object-oriented language because OOP wasn't added
until PHP 3.
- When PHP 5 was released in July 2004,the path of classes
and objects work in PHP was changed originally.
- PHP 4 objects are disability with those designed for PHP 5.
- PHP 6 handles objects is same to PHP 5.
- Object Oriented Programming(OOP) is technique to design
- You can create Modular Web Application with the help of
Benefits of OOP
- Reusability : An object is an entity which has
collection of properties and methods which can interact with other
- Refactoring :OOP provide the maximum benefit because
all objects are small entities and contain its properties and
methods as a part of itself.
- Maintenance :Object Oriented code is easier to
maintain because it follows coding strict conventions .
- Efficiency :Object Oriented programming is developed
for better efficiency and ease of development process.Some design
patterns are developed to create better and efficient code.
class is simply a representation of a type
- It is the blueprint/ plan/ template that describe the
details of an object.
- Class is known as fundamental building block of all
- A variable associated with a class is referred to as a
property,and a function is called a
- It is collection of related variables and functions, all
wrapped up in a pair of curly braces and labeled with the name of
//properties defined here.
//methods defined here.
- An Object is a real world entity.
- An object can be considered a "thing" that can perform a
set of related activities.
- you want to create an instance(object) of the class by
using the new keyword like this:
$obj = new First();
$obj=new First();//creates an object called $obj