Created
December 21, 2018 02:56
-
-
Save vahid-almasi/eaf5b2c8cac485dfac6abd3856bd9f61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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