<?php
function area()
class
Square extends Shape
{
function area()
{
return $area =
$this->r*$this->r;
}
}
class
Circle extends Shape
{
function __construct($x)
{
$this->x = $x;
}
function area ()
{
return PI * ($this->x *
$this->x);
}
}
$c
= new Triangle(12,4);
echo "<br>CIRCLE Area :
".$c->area();
echo
"<br>-----------------------------------------------------------------";
$r=new Circle(4);
echo "<br>Circle Area :
".$r->area();
$r=new Square(4);
echo "<br>Square:
".$r->area();
echo
"<br>-----------------------------------------------------------------";
?>