class Ball{
const SHAPE = "circular";
public $area = null;
}
class Football extends Ball{
const PI = 3.14;
public $radius;
public function __construct($radius){
$this->radius = $radius;
}
public function doIt(){
$this->area = PI*pow($this->radius,2);
return "the shape of the ball is:".self::SHAPE."the area is:".$this->area;
}
}
$fb = new Football(2.15);
echo $fb.doIt();
detailed code as above, there is no problem with writing the code, but it just can"t be executed, indicating that Call to undefined function doIt (), doesn"t know what"s going on.