$this
inside static methodsclass Circle {
public static $pi = 3.1415926535;
public $radius;
public function __construct($radius) {
$this->radius = $radius;
}
public function getArea() {
return pow($this->radius, 2) * self::$pi;
}
public function getPerimeter() {
return $this->radius * 2 * self::$pi;
}
}
$circle1 = new Circle(5);
echo "\nArea: " . $circle1->getArea();
echo "\nPerimeter: " . $circle1->getPerimeter();