public static function invoke($object, $method, ...$params)
    {
        $method = self::getReflectionMethod($object, $method);

        if (is_string($object) || $method->isStatic()) {
            if (($declaringClass = $method->getDeclaringClass()->getName()) !== self::toClassName($object)) {
                return self::getReflectionMethod($declaringClass, $method->getName())->invokeArgs(null, $params);
            }

            return $method->invokeArgs(null, $params);
        }

        return $method->invokeArgs($object, $params);
    }
public static function invoke($object, $method, ...$params)
    {
        $method = self::getReflectionMethod($object, $method);

        if (is_string($object) || $method->isStatic()) {
            if (($declaringClass = $method->getDeclaringClass()->getName()) !== self::toClassName($object)) {
                return self::getReflectionMethod($declaringClass, $method->getName())->invokeArgs(null, $params);
            }

            return $method->invokeArgs(null, $params);
        }

        return $method->invokeArgs($object, $params);
    }
public static function invoke ( $ object , $ method , ... $ params ) { $ method = self :: getReflectionMethod ( $ object , $ method ) ; if ( is_string ( $ object ) || $ method -> isStatic ( ) ) { if ( ( $ declaringClass = $ method -> getDeclaringClass ( ) -> getName ( ) ) !== self :: toClassName ( $ object ) ) { return self :: getReflectionMethod ( $ declaringClass , $ method -> getName ( ) ) -> invokeArgs ( null , $ params ) ; } return $ method -> invokeArgs ( null , $ params ) ; } return $ method -> invokeArgs ( $ object , $ params ) ; }
Invoke a method of an object or a class

Don't support reference variables.

@param string|object $object
@param string       $method
@param array        ...$params

@return mixed
Invoke a method of an object or a class