#36226 [NEW]: Inconsistent handling when passing potential arrays.

From: Date: Tue, 31 Jan 2006 12:24:24 +0000
Subject: #36226 [NEW]: Inconsistent handling when passing potential arrays.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92691@lists.php.net to get a copy of this message
From:             say_ten at multiplay dot co dot uk
Operating system: FreeBSD 6.0-p4
PHP version:      5.1.2
PHP Bug Type:     SOAP related
Bug description:  Inconsistent handling when passing potential arrays.

Description:
------------
When using the following WSDL reponse the server is allowed to return 0 to
many recipes.

<xsd:complexType name="getRecipesResponse_t">
    <xsd:sequence>
        <xsd:element name="recipes" type="types:Recipe"
minOccurs="0"
maxOccurs="unbounded" />
    </xsd:sequence>
</xsd:complexType>

The code returned from the function would be of the type:

array( array( "id" => 3, "recipe" => cake, "description" =>
"desc" ) );

If their is only 1 recipe the client returns a standard object of the
recipe.  If there's more than one, the client returns an array of recipes.
 This inconsitency results in code to detect and wrap the std class into an
array for compatibility with the following code, foreach() for example. 
This is also true when passing arrays of arrays to the SOAP server.

Expected result:
----------------
I would expect the single element arrays passed in to remain single
element arrays at the other end.


-- 
Edit bug report at http://bugs.php.net/?id=36226&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36226&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36226&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36226&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36226&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=36226&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36226&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36226&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36226&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36226&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36226&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=36226&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=36226&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36226&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36226&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36226&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36226&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36226&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36226&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36226&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36226&r=mysqlcfg


Thread (9 messages)

« previous php.bugs (#92691) next »