public static function invokeMethod(
        $object,
        $methodName,
        array $arguments = []
    ) {
        $reflectedObject = new ReflectionObject($object);
        $reflectedMethod = $reflectedObject->getMethod($methodName);
        $reflectedMethod->setAccessible(true);
        $reflectedMethod->invokeArgs($object, $arguments);
    }
public static function invokeMethod(
        $object,
        $methodName,
        array $arguments = []
    ) {
        $reflectedObject = new ReflectionObject($object);
        $reflectedMethod = $reflectedObject->getMethod($methodName);
        $reflectedMethod->setAccessible(true);
        $reflectedMethod->invokeArgs($object, $arguments);
    }
public static function invokeMethod ( $ object , $ methodName , array $ arguments = [ ] ) { $ reflectedObject = new ReflectionObject ( $ object ) ; $ reflectedMethod = $ reflectedObject -> getMethod ( $ methodName ) ; $ reflectedMethod -> setAccessible ( true ) ; $ reflectedMethod -> invokeArgs ( $ object , $ arguments ) ; }
Invokes the specified method on the specified object.

The method `invokeMethod` accepts a variable number of arguments which
are passed to the method of the object.

@param object  $object     The object on which to invoke the method.
@param strin   $methodName The name of the method to invoke.
@param mixed[] $arguments  The optional arguments to be passed to the
method.

@return void
Invokes the specified method on the specified object .