This is a follow up to my post about array problems with SOAP and PHP. The scenario was that when an array with only one object was returned over SOAP the array was discarded and pointed straight to the single object.
Cmm was kind enough to tip me this PHP bug report, which explains that this is actually not a bug, but a feature.
To get arrays containing one single element, simply create the SoapClient as follows:
1 | $x = new SoapClient($wsdl, array('features' => SOAP_SINGLE_ELEMENT_ARRAYS)); |
Related articles: