LoginSignup
2
2

More than 5 years have passed since last update.

文学的PHP

Last updated at Posted at 2012-02-22
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!

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2