From:             zhangsilly at gmail dot com
Operating system: Windows XP
PHP version:      5.2.10
PHP Bug Type:     XMLRPC-EPI related
Bug description:  xmlrpc_decode decode Hashtable response with integer key 
uncorrect

Description:
------------
xmlrpc_decode decode hashtable response with integer key will ignore the
key, just decode the same result as Vector.

Reproduce code:
---------------
ws-apache encode the Hashtable<Integer, String> as xmlrpc_decode's
parameter:
<?php
print_r(xmlrpc_decode('<?xml version="1.0"
encoding="UTF-8"?><methodResponse
xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions";><params><param><value><struct><member><name><value><i4>3</i4></value></name><value>wps2000</value></member><member><name><value><i4>0</i4></value></name><value>ddr</value></member></struct></value></param></params></methodResponse>'));

I format the xml response here:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse
xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions";>
        <params>
                <param>
                        <value>
                                <struct>
                                        <member>
                                                <name>
                                                        <value>
                                                                <i4>3</i4>
                                                        </value>
                                                </name>
                                                <value>wps2000</value>
                                        </member>
                                        <member>
                                                <name>
                                                        <value>
                                                                <i4>0</i4>
                                                        </value>
                                                </name>
                                                <value>ddr</value>
                                        </member>
                                </struct>
                        </value>
                </param>
        </params>
</methodResponse>

It seems the xmlrpc_decode just take Hashtable<Integer, Object> as
Vector<Object>

Expected result:
----------------
array(
    3  => wps2000
    0  => ddr
)

Actual result:
--------------
Array
(
    [0] => wps2000
    [1] => ddr
)


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

Reply via email to