<?php

abstract class First{
    
    protected $author;
    private $price;
    
    public function __construct($author , $price){
        $this->author = $author;
        $this->price = $price;
    }
    
    abstract public function description();
}


class Second extends First{
    public function description(){
        
        echo "This is the Second Description\n";
        echo "Price  : $this->author \n";
    }
}


class Third extends First{
    public function description(){
        echo "This is the Third Description \n";
        echo "Price  : $this->author \n";
    }
}

$secondObj = new Second("Sudhir" , 12.1);
$secondObj->description();

// When inheriting from an abstract class, the child class method must be defined with the same name, and the same or a less restricted access modifier. So, if the abstract method is defined as protected, the child class method must be defined as either protected or public, but not private. Also, the type and number of required arguments must be the same. However, the child classes may have optional arguments in addition.

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: