Classes and Objects in PHP 5
Classes begin with the keyword ‘class’, followed by the class name which the user may choose. The keyword ‘new’ used to create object from a class.
Inside the scope of a current class context, it is possible to create a objects by using keywords ‘self’ and ‘parent’;
eg: new self; new parent;
A class can inherit methods and members of another class by using the keyword ‘extends’;
eg: class inheritedclass extends parentclassname{ }
Any inherited methods and members of the parent class can be overridden, unless the parent class has defined a method by using the keyword ‘final’, by re declaring those methods or members with the same name defined in the parent class.

.jpg)