<?php
class Box
{
public $length=0;
public $breadth=0;
public $area=0;
function setValues($l,$b)
{
$this->length=$l;
$this->breadth=$b;
}
function calArea()
{
$area=$this->length*$this->breadth;
echo "area= $area"; //this function may return the value as well
}
} // end of class
$b1= new Box();
$b1->setValues(20,10);
$b1->calArea();
?>