时间:2021-07-01 10:21:17 帮助过:8人阅读
class Hero{
private $id;
private $name;
private $nickname;
private $next = null;
public function getId() {
return $this->id;
}
public function setId($id) {
$this->id = $id;
}
public function getName() {
return $this->name;
}
public function setName($name) {
$this->name = $name;
}
public function getNickname() {
return $this->nickname;
}
public function setNickname($nickname) {
$this->nickname = $nickname;
}
public function getNext() {
return $this->next;
}
public function setNext($next) {
$this->next = $next;
}
function __construct($id="",$name="",$nickname=""){
$this->id = $id;
$this->name = $name;
$this->nickname = $nickname;
}
}
?>
header("Cache-Control: no-cache, must-revalidate");
require_once 'SingleLink.class.php';
$head = new Hero();
$hero = new Hero(1,"宋江","及时雨");
echo $hero->getName();
?>