Skip to content

Instantly share code, notes, and snippets.

@stfalconaleks
Created October 26, 2017 14:15
Show Gist options
  • Save stfalconaleks/bfeb0f4a106c8248131166439f8e9da0 to your computer and use it in GitHub Desktop.
Save stfalconaleks/bfeb0f4a106c8248131166439f8e9da0 to your computer and use it in GitHub Desktop.
public function eat($food)
{
switch ($food) {
case 'carrot':
$this->getCalories(50);
break;
case 'cabbage':
$this->getCalories(100);
break;
default:
// If the rabbit eats unknown food - it dies :(
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment