十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
var test = function (){
this.str = '',
this.a = function (){
this.str += "a"
return this
},
this.b = function(){
this.str += "b"
return this
}
this.out = function(){
console.log(this.str)
}
}
var entity = new test()
entity.a().b().out()
ab
out .= $a;
return $this;
}
public function b($b){
$this->out .= $b;
return $this;
}
public function say(){
echo $this->out.PHP_EOL;
}
public function get(){
return $this->out;
}
}
$single = new single();
$out = $single->a('a')->b('b')->say();
$get = $single->a('a')->b('b')->get();
echo $get;
ab
abab