This is my class code:
class myClass { public function myFunc() { $myvar = \'Test str\'; } public function result() { echo myClas
class myClass { public $myvar; public function myFunc() { $this->myvar = 'Test str'; return $this; } public function result() { echo $this->myFunc()->myvar; } } $nCls = new myClass; $nCls->result();
You can do this but this is not a good practice.