Home » PHP


What is the abstraction in PHP?

Abstraction is the concept of moving the focus from the details and concrete implementation of things, to the types of things (i.e. classes), the operations available (i.e. methods), etc class A { private $isOn = false; public function on() { $this->isOn = true; } public function Off() { $this->isOn = …

Read More »

What is the encapsulation in PHP?

Wrapping some data in single unit is called Encapsulation. Encapsulation is used to safe data or information in an object from other it means encapsulation is mainly used for protection purpose. class A { private $name; public function setName($name) { $this->name = $name; } public function getName($name) { return $this->name; …

Read More »

What is the Polymorphism in PHP?

Polymorphism is one of the PHP Object Oriented Programming (OOP) features. Polymorphism is derived from two Greek words. Poly (meaning many) and morph (meaning forms). In general, polymorphism means the ability to have many forms. In other words, “Polymorphism describes a pattern in Object Oriented Programming in which a class …

Read More »

What is the inheritance in PHP?

Inheritance is the process in which object of one class acquire the properties of another class. The following types of inheritance is supported in php- Single Level Inheritance – In Single Level the Parent class methods will be extended by the child class. All the methods can be inherited. class …

Read More »