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();