예제 #1
0
    protected $age = 39;
    public function tell()
    {
        echo $this->wife, '<br />';
    }
    public function cry()
    {
        echo '555555<br />';
    }
    public function hShow()
    {
        echo $this->wife, '<br />';
    }
}
class Stu extends Human
{
    private $wife = '小猪猪';
    public function sShow()
    {
        parent::hShow();
        echo $this->wife, '<br />';
    }
    public function getAge()
    {
        return $this->age = 20;
    }
}
$lisi = new Stu();
echo '<pre>';
echo $lisi->getAge();