Skip to content

Instantly share code, notes, and snippets.

@appsol
Created March 6, 2014 14:42
Show Gist options
  • Save appsol/9391216 to your computer and use it in GitHub Desktop.
Save appsol/9391216 to your computer and use it in GitHub Desktop.
class daughter extends parent implements teenager {
public $attitude;
private $moods = array('happy', 'angry', 'sulky', 'upset', 'silly', 'grumpy');
public function __construct() {
$this->attitude = $this->moods[array_rand($moods)];
$this->wakeup(time());
}
private function wakeup($now) {
if(date('H', $now) < 11) {
$this->attitude = 'grumpy';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment