# is this a bug in SoapServer?

- Thread: https://externals.io/message/28730
- Original archive: https://news-web.php.net/php.internals/28730
- Started by Ron Korving on 2007-04-11T12:32:38+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28730 — Ron Korving — 2007-04-11T12:32:38+00:00

URL: https://externals.io/message/28730#28730

Hi,

returning array('5' => 'Foo', '10' => 'Bar') from a SoapServer handler class 
ends up as array(0 => 'Foo', 1 => 'Bar') at the client end. I can hardly 
imagine this being a feature, but maybe someone can tell me if this is 
somehow wanted or inevitable behavior.

Thanks,

Ron Korving

---

## #28731 — Lukas Kahwe Smith — 2007-04-11T14:00:29+00:00

URL: https://externals.io/message/28730#28731 · In reply to: #28730

Ron Korving wrote:
> Hi,
> 
> returning array('5' => 'Foo', '10' => 'Bar') from a SoapServer handler class 
> ends up as array(0 => 'Foo', 1 => 'Bar') at the client end. I can hardly 
> imagine this being a feature, but maybe someone can tell me if this is 
> somehow wanted or inevitable behavior.

I assume its because there is no such thing as an associative array, so 
the thing ends up being a simple ordered sequence.

regards,
Lukas

---

## #28732 — Ron Korving — 2007-04-11T14:04:47+00:00

URL: https://externals.io/message/28730#28732 · In reply to: #28731

But array('a' => 'Foo', 'b' => 'Bar') does end up correctly. It only fails 
with numeric keys. I'm using PHP 5.2.1 by the way.

Thanks,

Ron


"Lukas Kahwe Smith" <mls@pooteeweet.org> schreef in bericht 
news:461CE9FD.4070108@pooteeweet.org...
> Ron Korving wrote:
> > […]
>
> I assume its because there is no such thing as an associative array, so 
> the thing ends up being a simple ordered sequence.
>
> regards,
> Lukas
