PHP OOP-Final Keyword

In PHP, we can’t declare variables as Final. Only classes and class methods are allowed to use the Final keyword. If we define a class method as Final, the child class will not be able to override that method of the parent class. Similarly to methods, declaring a class as Final prevents it from being expanded.

PHP OOP – Inheritance

When a class descends from another class in Object-Oriented Programming, this is referred to as inheritance. The derived class is known as child/subclass. The class from which the child class is derived is known as the super/parent class. The parent class’s public and protected properties and methods are passed down to the child class. A … Read more

PHP OOP-Class Constants

Constants are bits of data saved in the computer’s memory that can not be modified once they have been assigned. Constants declared within classes are known as class constants. Declaring Class Constants A class constant is declared with the const keyword. Class constant must be declared inside class. Note: Class constants are case-sensitive. It is preferred that … Read more

PHP OOP – Encapsulation

Encapsulation allows us to hide properties and methods within a class such that they are not accessible by other classes. In PHP access modifiers are used for encapsulation, these modifiers are simply PHP keywords, to set the access permissions for class methods and variables. Some of the access modifiers can even be applied to the class … Read more

PHP OOP Destructor

When an object destructs, destructors are called. It’s usually when the script comes to an end. The destruct function is called at the end of the script. Note: Constructor and destructor both are used to reduce the code so they are useful. Destructor Syntax: The destructor function is named destruct and is followed by a double … Read more

PHP OOP Constructor

Constructors are functions used for creating newly created object instances from a class. When creating an object, the constructor function is used to set the object’s properties. When you create an object from a class, PHP will automatically call the __construct() function you defined. Constructor Syntax: It is a public function that is written as … Read more

PHP OOP- Class and Object

A class is an independent set of variables and functions that interact to complete one or more tasks. Basically class is a template for multiple objects. While individual instances of a class are called objects. Class and Object Class Object A class is an independent set of variables and functions that interact to complete one or more … Read more

PHP – OOP

PHP-OOP is more efficient and simpler to use. PHP -What is OOP? Object-oriented programming is about constructing objects that include both data and functions, whereas procedural programming is about developing procedures or functions that perform actions on the data. There are various advantages of OOP over procedural programming: OOP programmes have a clear structure. It … Read more

Install LAMP (Linux, Apache, MySql & PHP) on Ubuntu 20.04 AWS EC2

In this tutorial, we will guide you through the step-by-step process of installing LAMP (Linux, Apache, MySQL, PHP) on an Ubuntu 20.04 AWS EC2 instance. How to Install LAMP (Linux, Apache, MySql & PHP) on Linux Ubuntu 20.04 AWS EC2 Step 1 – Launching a Virtual Machine Log into the AWS EC2 Management Console, and click … Read more