title: PHP SoapClient type mapping behaves differently
body: <p>I've a web-service function which is returning an array of items to a PHP-Client. Depending on the number of items, the PHP return type is differently. If the function returns one item the PHP type is <code>stdClass</code> if the function returns more than one item, the PHP type is <code>array</code>. In either case it should be <code>array</code>. What can I do to achieve this?</p>
  
  <p><h3>Details:</h3> A <code>var_dump</code> of the result from the web-service function looks like following:</p>
  
  <ul>
  <li>if one item is in the result:<br/><code>array(3) { ["filterErg"]=&gt; object(stdClass)#37 (1) { ["item"]=&gt; object(stdClass)#38 (9) ...</code></li>
  <li>if more than one item is in the result:<br/><code>array(3) { ["filterErg"]=&gt; object(stdClass)#37 (1) { ["item"]=&gt; array(16) ...</code></li>
  </ul>
  
  <p>The name of the function is <code>getFilter</code> and the relevant parts of the WSDL File are:</p>
  
  <pre><code>&lt;types&gt;
    &lt;schema ...&gt;
      &lt;complexType name="arrayFilter"&gt;
        &lt;sequence&gt;
          &lt;element name="item" type="ns1:stFilter" minOccurs="0" maxOccurs="unbounded" nillable="true"/&gt;
        &lt;/sequence&gt;
      &lt;/complexType&gt;
      ...
    &lt;/schema&gt;
  &lt;/types&gt;
  
  &lt;message name="getFilterResponse"&gt;
    &lt;part name="filterErg" type="ns1:arrayFilter"/&gt;
    &lt;part name="functionResult" type="xsd:int"/&gt;
    &lt;part name="outErr" type="xsd:string"/&gt;
  &lt;/message&gt;
  
  &lt;portType name="ADServicePortType"&gt;    
    &lt;operation name="getFilter"&gt;
      &lt;documentation&gt;Service definition of function ns1__getFilter&lt;/documentation&gt;
      &lt;input message="tns:getFilter"/&gt;
      &lt;output message="tns:getFilterResponse"/&gt;
    &lt;/operation&gt;
    ...
  &lt;/portType&gt;
  
  &lt;binding name="ADService" type="tns:ADServicePortType"&gt;
    &lt;SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
    &lt;operation name="getFilter"&gt;
      &lt;SOAP:operation style="rpc" soapAction=""/&gt;
      &lt;input&gt;
        &lt;SOAP:body use="encoded" namespace="urn:ADService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
      &lt;/input&gt;
      &lt;output&gt;
        &lt;SOAP:body use="encoded" namespace="urn:ADService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
      &lt;/output&gt;
    &lt;/operation&gt;
    ...
  &lt;/binding&gt;
  </code></pre>