Skip to content

Instantly share code, notes, and snippets.

@riaf
Created February 22, 2012 14:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riaf/1885308 to your computer and use it in GitHub Desktop.
Save riaf/1885308 to your computer and use it in GitHub Desktop.
文学的PHP ref: http://qiita.com/items/2730
<?php
/**
* 吾輩は猫である
*
* @author Souseki Natsume
* @author Keisuke SATO <riaf@me.com>
*/
// 吾輩は猫である
$me = new Cat;
// 名前はまだ無い
if (!$me->getName()) {
throw new Exception('undefined name');
}
<?php
class Cat
{
protected $name;
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment