Edited at

文学的PHP

More than 5 years have passed since last update.


Cat.php

<?php

class Cat
{
protected $name;

public function getName()
{
return $this->name;
}

public function setName($name)
{
$this->name = $name;
}
}



app.php

<?php

/**
* 吾輩は猫である
*
* @author Souseki Natsume
* @author Keisuke SATO <riaf@me.com>
*/

// 吾輩は猫である
$me = new Cat;

// 名前はまだ無い
if (!$me->getName()) {
throw new Exception('undefined name');
}



Fork me on Github!