Re: A single elemet array turns into an object
| From: | Roman Romanov | Date: | Wed, 10 Sep 2003 20:34:29 +0000 |
| Subject: | Re: A single elemet array turns into an object | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1040@lists.php.net to get a copy of this message | ||
Hi
With 0.8RC1 I have not such problem any more.
I use special TArray class for manipulating arrays in my SOAP servers.
Roman.
"Mike Carter"
> Hi,
>
> I've noticed some strange behaviour with arrays and the SOAP. Its
> always been like this, I've just not had time to report it.
>
> When PEAR SOAP client recieves an array which has just one element in it
> - it gets converted to a stdClass. If more than one element in the
> array then I get an array.
>
> Currently this means I must first do a is_array() check on the result
> before passing it through something like a foreach() loop.
>
> Is there a way to prevent such a strange behaviour? I'm guessing it has
> something to do with the automatic type conversion process in PEAR::SOAP
> ?
>
> Regards,
>
>
>
> Mike C
>
>
> ________________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> ________________________________________________________________________