PHP Interface | Object Oriented Concepts

An Interface in PHP allows you to create methods which a class must implement, without giving any details about its implementation. They resemble abstract methods in an abstract class. However, unlike Abstract Classes you don’t need to provide the implementation of methods in an Interface. In this article, we will discuss PHP Interfaces along with… Read more PHP Interface | Object Oriented Concepts

Abstract Classes in PHP | Object Oriented Concepts

A Child Class can inherit properties from a Parent Class. Also, you can directly create an object of a Parent Class. However, you can’t instantiate an object of an Abstract Class directly. In this article, we will discuss Abstract Classes in PHP. Also, we will discuss their implementation along with a few examples. You might… Read more Abstract Classes in PHP | Object Oriented Concepts

Final Keyword in PHP | Object Oriented Concepts

A class can inherit properties from a parent class. However, it can only inherit public and protected properties. Also, the child class can override methods of the parent class. PHP introduces the Final Keyword, which prevents the child class from overriding methods of the parent class by prefixing it with Final Keyword. Additionally, no other… Read more Final Keyword in PHP | Object Oriented Concepts

Class Constants in PHP | Object Oriented Concepts

Constants are a bit different than regular variables in PHP. Class Constants are immutable properties. Therefore, you cannot change the value after defining it for the first time. In this article, we will discuss Class Constants in PHP. What are Class Constants in PHP? It is possible to define Class Constants in PHP. A constant… Read more Class Constants in PHP | Object Oriented Concepts

Constructors | Object Oriented Programming in PHP

In my previous post on Object-Oriented Programming, we learned about Access Modifiers. Let’s take the discussion forward to some advanced concepts. In this article, we will discuss Constructors. If you are new to Object Oriented Programming, please read my beginner post on it first. Class Constructors A constructor is a special method in a Class… Read more Constructors | Object Oriented Programming in PHP

Static Keyword | Object Oriented Programming in PHP

We discussed public and private Access Modifiers earlier. Sometimes, we require access to a Class’s members without creating an object. In this situation, we use Static Keyword in PHP. Defining a class property static makes it accessible without instantiating an object of the class. In this article, we will discuss the use of Static Keyword… Read more Static Keyword | Object Oriented Programming in PHP

Access Modifiers | Object Oriented Programming in PHP

In the previous post, we introduced Object Oriented Programming in PHP. We discussed the difference between Class and Object. Also, we learned to create a basic Class in PHP. In this article, we will discuss Access Modifiers. If you are new to Object Oriented Programming, I would recommend you to go through my first article… Read more Access Modifiers | Object Oriented Programming in PHP

Object Oriented Programming Concepts in PHP | Introduction

Object oriented programming concept is a programming concept in which all properties and behavior of entities are grouped into a single entity called a class. This style is considered much more advanced and efficient than the Procedure style of programming. It gives us modularity, reusability and better organization of code. In this article, we will… Read more Object Oriented Programming Concepts in PHP | Introduction