Explain abstract class in PHP.

PHP5 comes with the object-oriented model with it, Some of the concepts of object-oriented model are: class, object, encapsulation, polymorphism, abstract and final classes, and methods, interfaces and inheritance, etc... In this article, 
we will discuss Abstract Class and it's features related to the object-oriented techniques in PHP. Also, we will learn the implementation of Abstract Class along with few examples.
But, before diving too deep,let's learn how to define abstract class.
We can declare a class as abstract by affixing the name of the class with the abstract keyword. The definition is very clear, the class that contains abstract methods is known as abstract class. Abstract methods define in the abstract class just have name and arguments, and no other code.
An object of an abstract class can't be made. Rather, we need to extend child classes that compute the definition of the function into the bodies of the abstract methods in the child classes and utilize these child classes to create objects.
Let's discuss some important facts about abstract classes in PHP:
<?php
   abstract class base {
      abstract function printdata();
      public function getdata() {
         echo "Tutorials Point";
      }
   }
   class child extends base{
      public function printdata(){
         echo "Good morning";
      }
   }
   $obj = new child();
   $obj->getdata();
?>
Tutorials Point
<?php
   abstract class AbstractClass{
      abstract protected function calculate();
      public function adddata() {
         echo "Addition done";
      }
   }
   $obj=new AbstractClass();
   $obj->adddata();
?>
Fatal error: Uncaught Error: Cannot instantiate abstract class AbstractClass
All child class must define all the methods marked as abstract in the parent class, with all these methods need to be defined with the same signature or less restricted signature. Suppose In parent class if we define an abstract method with protected visibilty, in the child class execution it should be defined with protected aorpublic, but not with private.
<?php
   abstract class AbstractBaseClass1{
      abstract public function addValue();
      abstract protected function getValue();
   }
   class ConcreteClass extends AbstractBaseClass1{
      protected function addValue() {
         return "ConcreteClass";
      }
      public function getValue() {
         return " Child Class";
      }
   }
   $classobj = new ConcreteClass;
   $classobj->addValue();
?>
Fatal errorAccess level to ConcreteClass::addValue() must be public (as in class AbstractBaseClass1)
Methods declared as abstract simply declare the method's signature - they cannot define anybody inside them. Although the body can be present inside a non-abstract method.
<?php
   abstract class ParentClass{
      abstract protected function printValue(){
         return "Good morning";
      }
   }
   class ClassA extends ParentClass{
      protected function printValue() {
         return "ConcreteClass1";
      }
   }
   $classobj = new ClassA;
   $classobj->printValue();
?>
PHP Fatal error: Abstract function ParentClass::printValue() cannot contain body
An abstract class can have abstract and non-abstract methods, but it must contain at least one abstract method. If it contains an abstract method then it should be declared as abstract.
<?php
   class AbstractClass {
      abstract protected function getValue();
      public function printData() {
         echo " Welcome to Tutorials Point";
      }
   }
   $obj=new AbstractClass();
   $obj->printData();
?>
PHP Fatal error: Class AbstractClass contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (AbstractClass::getValue)
It doesn't support multiple inheritance.
<?php
   Abstract class SuperClass{
      public abstract function test();
      protected function welcome(){
         echo "Good morning";
      }
   }
   class ClassA extends SuperClass{
      public function test(){
         echo "Hello";
      }
      protected function welcome(){
         echo "Good afternoon";
      }
   }
   class ClassB extends SuperClass{
      public function test(){
         echo "Hello";
      }
      protected function welcome(){
         echo "Good evening";
      }
   }
   class ClassC extends ClassA, ClassB{
      public function test1(){
         $c = new self();
         $c->welcome();
      }
   }
?>
Error
Here we have declare SuperClass as an abstract class having a method test() and welcome() and, ClassA and ClassB and concrete classes extend from an abstract class. Then we have tried to create ClassC extending from ClassA and ClassB. As it is evident from the code, on calling the method welcome() using object ClassC, it’s impossible for the compiler to choose whether it has to call ClassA’s welcome() or ClassB’s welcome() method. So, to stay away from such complications, PHP does not support multiple inheritance.
An abstract class can extend another abstract class, Abstract class can provide the implementation of the interface.