PHP OOP – Traits

The trait keyword is used to create traits. Traits are a way to allow classes to inherit multiple behaviours. Traits provide a way to reuse code across multiple classes without the…

0 Comments

PHP OOP – Interfaces

An Interface allows the users to create programs, specifying the public methods that a class must implement, without involving the complexities and details of how the particular methods are implemented.…

0 Comments

PHP OOP – Abstract Classes

We can not make object of an abstract class. If we want to use it then we can inherit only. Abstract class have two condition compulsary: 1. atleast one abstract…

0 Comments

PHP – Class Constants

Class constants can be useful if you need to define some constant data within a class. A class constant is declared inside a class with the const keyword. A constant cannot…

0 Comments

PHP – The final Keyword

Final methods: When a method is declared as final then overriding on that method can not be performed. Methods are declared as final due to some design reasons. Method should not…

0 Comments

PHP – Overriding Inherited Methods

Function overloading and overriding is the OOPs feature in PHP. In function overloading, more than one function can have same method signature but different number of arguments. But in case…

0 Comments

PHP OOP – Inheritance

When a class derives from another class. The child class will inherit all the public and protected properties and methods from the parent class. In addition, it can have its…

0 Comments