Annotation of embedaddon/php/ext/xmlrpc/tests/bug37057.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #37057 (xmlrpc_decode() may produce arrays with numeric string keys which are unaccessible)
3: --SKIPIF--
4: <?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
5: --FILE--
6: <?php
7: $response='<?xml version="1.0"?>
8: <methodResponse>
9: <params>
10: <param>
11: <value>
12: <struct>
13: <member>
14: <name>50</name>
15: <value><string>0.29</string></value>
16: </member>
17: </struct>
18: </value>
19: </param>
20: </params>
21: </methodResponse>';
22:
23: $retval=xmlrpc_decode($response);
24: var_dump($retval);
25: var_dump($retval["50"]);
26: var_dump($retval[50]);
27:
28: $response='<?xml version="1.0"?>
29: <methodResponse>
30: <params>
31: <param>
32: <value>
33: <struct>
34: <member>
35: <name>0</name>
36: <value><string>0.29</string></value>
37: </member>
38: </struct>
39: </value>
40: </param>
41: </params>
42: </methodResponse>';
43:
44: $retval=xmlrpc_decode($response);
45: var_dump($retval);
46: var_dump($retval["0"]);
47: var_dump($retval[0]);
48:
49: echo "Done\n";
50: ?>
51: --EXPECT--
52: array(1) {
53: [50]=>
54: string(4) "0.29"
55: }
56: string(4) "0.29"
57: string(4) "0.29"
58: array(1) {
59: [0]=>
60: string(4) "0.29"
61: }
62: string(4) "0.29"
63: string(4) "0.29"
64: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>