Latest Posts

What is the difference between public, private, and protected php7

What is the difference between public, private, and protected ?



In Object oriented programming we can define visibility as public, protected, private. So Public variables can be used inside or outside of the class. Whereas Protected and Private variables cannot be used outside of class. The deference between Protected and private Visibility. Private variable can be used inside of class where that variable is defined. […]



How to use Constants in php 7

How to define constant in PHP 7



What is Constants In PHP In Object Oriented Programming we can define constants. Mainly when you want to use some variables with some values and you want to make sure the value to that variable never changes then you use constant. Once value is defined to constant it cannot be changed. Here is how constant […]



Data encapsulation in PHP 7

Data encapsulation in PHP 7



What is Data Encapsulation Data Encapsulation also known as Data Hiding is a very vital object oriented programming concept. In this mechanism user can perform restricted set of operations of the class. So mainly in simple words we set variables to private then they can be used by functions but user cannot change values of […]



INHERITANCE IN PHP 7

INHERITANCE IN PHP 7



What is Inheritance In Object Oriented Programming inheritance is a concept of extending a class. So if you have a base class let’s say “Vehicle Class”. This class might have functions those can be applied to all vehicles such as wheels, colour, fuel etc. So if you create a child class named “Car class”. Then […]



Function overriding in PHP with simple example

Function overriding in PHP with simple example



What is Overriding Function overriding is a concept of Object Oriented Programming where we crate function with same name in parent and child class. And PHP calls the function from child class if function present in child class otherwise it looks in parent class. Here is the example In the code example you can see […]



Final class in PHP with example

Final class in PHP with example



What is Final Keyword The concept of Final keyword is important as we can restrict the use of class using this keyword. In Object Oriented Programming when you want to make sure that no one can extend the class you made you can add “Final” keyword in from of class. So this class will not […]



Abstract class in PHP simple example 2020

Abstract class in PHP simple example 2020



What is Abstract Class In Object Oriented Programming Abstract keyword is very useful. If we want to create a class that cannot be instantiated but can be extended then we add “abstract” keyword to that class. Abstract classes are mainly can be extended but cannot be instantiated. If the keyword extend is added in front […]