ID:               21949
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         XMLRPC-EPI related
 Operating System: Red Hat Linux 8.0
 PHP Version:      4.2.3
 New Comment:

Not a bug, XML-RPC is ambigous as to the value that the <name> field
can contain.  However, all indications point to it being a string
value, in XML this represents a value that is non-numeric.


Previous Comments:
------------------------------------------------------------------------

[2003-01-29 13:10:04] [EMAIL PROTECTED]

When I run a sequence such as:

$test = array(1234 => 5, 5678 => 2);
$rpc = xmlrpc_encode_request("method", $test);
print $rpc;

the XMLRPC extension does not observe the non-zero-indexed nature of
the array and produces a request such as:

  <?xml version="1.0" encoding="iso-8859-1" ?> 
- <methodCall>
  <methodName>method</methodName> 
- <params>
- <param>
- <value>
  <int>5</int> 
  </value>
  </param>
- <param>
- <value>
  <int>2</int> 
  </value>
  </param>
  </params>
  </methodCall>

At the other end, this decodes to:

array(0 => 5, 1 => 2)

which is not the same as the original data passed. The same occurs when
using string types using numeric values as the array keys, eg.

array("1234" => 5, "5678" => 2)

or by using settype(... "string") on the array keys.

I believe that the XMLRPC extension should generate a <struct> for
arrays such as this, so that the number key to value mapping can be
preserved.

Regards,

Chris.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21949&edit=1

Reply via email to