版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_21441663/article/details/80964355
class Test {
/**
* name.
*
* @var
*/
private $name;
/**
* set name value
*
* @author: hh
* @return $this
*/
public function setName()
{
$this->name = 'test';
return $this;
}
/**
* get name value.
*
* @author: hh
* @return mixed
*/
public function getName()
{
return $this->name;
}
}
// 调用
$test = new Test();
echo $test->setName()->getName();