[PHP5 SOAP] bug or quirk?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While using the PHP5 SOAP extension to query web services we ran into something we're not sure to consider it a bug or a quirk. Here's what happens:

When calling a web service, certain fields in the response are defined to contain multiple values (they're arrays). However, when only one value is there, the extension just assigns the value instead of creating an array. For example, some query returns one string, "hello world", in the field arr:
// expected:
print_r( $response->arr ) // array( [0] => 'hello world' )


// reality:
print_r( $response->arr ) // 'hello world'

It's not a huge deal because type casting makes everything better:
foreach( (array) $response->arr as $value ) {
// loop works in all cases
}

So, what do you think? Is it a bug in the extension or a quirk due to the shift from a strictly typed language to a loose one?

-Nikolas Coukouma

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux