public static function callMethod($object, $method, $args = null)
    {
        $args   = \func_get_args();
        $object = \array_shift($args);
        $method = \array_shift($args);

        $refl = new \ReflectionObject($object);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(true);

        return $reflMethod->invokeArgs($object, $args);
    }
public static function callMethod($object, $method, $args = null)
    {
        $args   = \func_get_args();
        $object = \array_shift($args);
        $method = \array_shift($args);

        $refl = new \ReflectionObject($object);
        $reflMethod = $refl->getMethod($method);
        $reflMethod->setAccessible(true);

        return $reflMethod->invokeArgs($object, $args);
    }
public static function callMethod ( $ object , $ method , $ args = null ) { $ args = \ func_get_args ( ) ; $ object = \ array_shift ( $ args ) ; $ method = \ array_shift ( $ args ) ; $ refl = new \ ReflectionObject ( $ object ) ; $ reflMethod = $ refl -> getMethod ( $ method ) ; $ reflMethod -> setAccessible ( true ) ; return $ reflMethod -> invokeArgs ( $ object , $ args ) ; }
Call a method on an object, bypassing visibility restrictions.

@param object $object
@param string $method  method name
@param mixed  $args...

@return mixed
Call a method on an object bypassing visibility restrictions .