Skip to content

Instantly share code, notes, and snippets.

@vahid-almasi
Created December 21, 2018 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vahid-almasi/eaf5b2c8cac485dfac6abd3856bd9f61 to your computer and use it in GitHub Desktop.
Save vahid-almasi/eaf5b2c8cac485dfac6abd3856bd9f61 to your computer and use it in GitHub Desktop.
<?
interface ShapeInterface {
public function area();
}
class Circle implements ShapeInterface {
public $radius;
public function __construct($radius) {
$this->radius = $radius;
}
public function area() {
return pi() * pow($this->radius, 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment