title: Passing arguments when loading custom CodeIgniter library
body: <p>I'm trying to implement a class I've written as CodeIgniter library.</p>
  
  <p>Somehow I can't get CI's <code>load()</code> method to pass multiple arguments to the class's constructor function.</p>
  
  <p>My class is designed to get 3 arguments, 2 arrays and one optional string.</p>
  
  <p>The constructor looks somewhat like this:</p>
  
  <pre><code>public function __construct($array, $array,$string=""){
  /** code **/
  }
  </code></pre>
  
  <p>The relevant part from the controller:</p>
  
  <pre><code>function index(){
    $array1 = array('key1'=&gt;'value','key2'=&gt;'value');
    $array2 = array('key1'=&gt;'value','key2'=&gt;'value');
    $string = "value";
    $params = array($array1,$array2,$string);
    $this-&gt;load-&gt;library("MyClass",$params);
  }
  </code></pre>
  
  <p>Loading the controller generates this error :</p>
  
  <pre><code>Message: Missing argument 2 for MyClass::__construct()
  </code></pre>
  
  <p>This is really puzzling me. It seems the first argument gets sent fine and then it chokes on the second argument. Any clues on why this is happening will be greatly appreciated.</p>