public function exists($instance, string $method)
    {
        $reflection = new ReflectionClass(get_class($instance));

        return $reflection->hasMethod($method);
    }
public function exists($instance, string $method)
    {
        $reflection = new ReflectionClass(get_class($instance));

        return $reflection->hasMethod($method);
    }
public function exists ( $ instance , string $ method ) { $ reflection = new ReflectionClass ( get_class ( $ instance ) ) ; return $ reflection -> hasMethod ( $ method ) ; }
Checks whether a specific method is defined in a class

@param mixed $instance
@param string $method
@return bool
Checks whether a specific method is defined in a class