src/Google/AdsApi/Common/Util/Reflection.php
public function createInstance($className, $args = null)
    {
        $reflectionClass = new ReflectionClass($className);
        $args = func_get_args();
        array_shift($args);

        return $reflectionClass->newInstanceArgs($args);
    }
public function createInstance($className, $args = null)
    {
        $reflectionClass = new ReflectionClass($className);
        $args = func_get_args();
        array_shift($args);

        return $reflectionClass->newInstanceArgs($args);
    }
public function createInstance ( $ className , $ args = null ) { $ reflectionClass = new ReflectionClass ( $ className ) ; $ args = func_get_args ( ) ; array_shift ( $ args ) ; return $ reflectionClass -> newInstanceArgs ( $ args ) ; }
Creates a new instance of the specified class name.

@param string $className the fully qualified class name
@param mixed $args a variable number of arguments to pass to the class
constructor
@return mixed the created object instance
@throws \ReflectionException if the object instance could not be created
Creates a new instance of the specified class name .