TypechoJoeTheme

Dcr163的博客

统计

PHP面向对象中对象链的使用操作

2015-10-18
/
0 评论
/
689 阅读
/
正在检测是否收录...
10/18
/ 对象链的使用操作
class Xiao{
public $name;
public $sex;
 
function __construct($name,$sex){
$this->name=$name;
$this->sex=$sex;
}
function say(){
echo "我的名字叫{$this->name}<br/>";
return $this;
}
function sex(){
echo "我的性别是{$this->sex}<br/>";
}
 
}
$jun=new Xiao('小明','20');
 
$jun->say()->sex();





 
 
 
朗读
赞(0)
版权属于:

Dcr163的博客

本文链接:

https://dcr163.cn/60.html(转载时请注明本文出处及文章链接)

评论 (0)

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

最新回复

  1. William Tardent
    2024-02-27
  2. Maryann Hamer
    2024-02-27
  3. Sanora Pantano
    2024-02-24
  4. aa
    2024-02-21
  5. Kassie Baum
    2024-01-28

标签云