Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created February 17, 2010 02:29
Show Gist options
  • Select an option

  • Save ukstudio/306224 to your computer and use it in GitHub Desktop.

Select an option

Save ukstudio/306224 to your computer and use it in GitHub Desktop.
<?php
class Square {
private $height;
private $width;
public function setLength($length) {
$this->height = $length;
$this->width= $length;
}
public function getHeight() {
return $this->height;
}
public function getWidth() {
return $this->width;
}
}
$square = new Square();
$square->setLength(100);
echo $square->getHeight(); // 100
echo $square->getWidth(); // 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment