Cone of volume using the OOP of php

using accesser method,property,


class Cone1{
const PI = 3.14;
private $radius;
private $height;

public function setRadius($base){
$this->radius = $base;
public function setHeight($height){
$this->height = $height;
public function getRadius(){
return $this->radius;
public function getHeight(){
return $this->height;
public function getVolume(){
$area = pow($this->radius,2) * self::PI;
return $area * $this->height / 3;

<!DOCTYPE html>
<meta charset="utf-8">
<title>The volume of the cone</title>
<h2>use OOP of PrivateAccesser</h2>
require_once 'Cone1.php';
$obj = new Cone1();
print "The bottom surface of the radius: {$obj->getRadius()}" . '<br>';
print "The height of the cone: {$obj->getHeight()}" . '<br>';

    print &quot;The volume of the cone: {$obj-&gt;getVolume()}&quot;;