Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Rectangle
- {
- public $length;
- public $width;
- public function __construct($x,$y)
- {
- $this -> length = $x;
- $this -> width = $y;
- }
- public function getPerimeter()
- {
- return (2 * ($this->length + $this->width));
- }
- public function getArea()
- {
- return ($this->length * $this->width);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment