I have class sample and first call static method and return to call other public method:
class foo{ public static $var; public static function first() { self::$var = 1; return self::class; } public function second() { return self::$var; } } and I need call public method after static method sample here:
foo::first()->second();
secondmethod to astring. so it won't work. return the instance on thefirst, then chainsecond. like the answer below