Maison > Questions et réponses > le corps du texte
$str = new str();
//类似这种链式操作,如何实现?
$str->str()->length();
巴扎黑2017-04-11 10:48:34
Class MyClass {
public function doWork() {
echo "work done\n";
return $this;
}
public function doAnotherWork() {
echo "another work done\n";
return $this;
}
}
(new MyClass())->doWork()->doAnotherWork();