title: PHP Xml-RPC array and struct
body: <p>I am using XML-RPC Lib for PHP to use online signature. </p>
  
  <p>This is the official doc :</p>
  
  <pre><code>$doc = array(
        "content" =&gt; new xmlrpcval($doc_content, "base64"),
        "name" =&gt; new xmlrpcval($doc_name, "string")
  );
  
  $language = "fr";
  $signers = array(new xmlrpcval($signer, "struct"));
  
  $request = array(
      "documents" =&gt; new xmlrpcval(array(new xmlrpcval($doc, "struct")), "array"),
      ...  
  </code></pre>
  
  <p>But now I want to put several documents in the request. Here is my code :
      $docs = array();</p>
  
  <pre><code>foreach ($documents as $document)
  {
      // Signature field
      $field = array(
          'page'  =&gt; new xmlrpcval($document-&gt;page, 'int'),
          'x'     =&gt; new xmlrpcval($document-&gt;x, 'int'),
          'y'     =&gt; new xmlrpcval($document-&gt;y, 'int'),
          'label' =&gt; new xmlrpcval($document-&gt;nom, 'string'),
      );        
  
      // Document
      $docs []= new xmlrpcval(array(
          'content'   =&gt; new xmlrpcval($document-&gt;content, 'base64'),
          'name'      =&gt; new xmlrpcval($document-&gt;nom, 'string'),
          'signatureFields'   =&gt; new xmlrpcval($field, 'array'),
      ),'struct');
  }
  
  $request = array(
      'documents'     =&gt; new xmlrpcval($docs, 'array'),
  </code></pre>
  
  <p>And I catch this error : </p>
  
  <blockquote>
    <p>Message: Call to a member function serialize() on a non-object</p>
  </blockquote>
  
  <p>Does someone allready used this library ? Cause I am lost right now..</p>