PHP EXTENDS 小记

论坛 期权论坛 脚本     
已经匿名di用户   2022-5-29 19:29   2587   0

<?php
/*
* Created on 2009-10-23
* 分子如梦o(╯□╰)o
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/

class people
{

private $name;
public $age;

function __set($po,$value)
{
$this->$po=$value;

}

function __get($peoson_name)
{
return $this->$peoson_name;
}

private function vod()
{
return "你好:".$this->name.";";
}

function people_()
{

return $this->vod()."你出生日是:".$this->age;

}

function __destruct()
{
echo "<br>========";
}

}


class person extends people
{
function people_()
{
return people::people_();
}

function person_property()
{
echo $this->people_()."<br>恭喜您今天过生日---------<br>";

}

}

$pop = new person();
$pop->name="小明";
$pop->age="1985-10-23";
echo $pop->person_property();

?>

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:81
帖子:4969
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP