| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2003-01-30 09:35 UTC] sterling@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 03:00:01 2025 UTC | 
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.