Bug #14521: XMLRPC extension: wrong results?
| From: | cmv@php.net | Date: | Fri, 14 Dec 2001 17:51:07 +0000 |
| Subject: | Bug #14521: XMLRPC extension: wrong results? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-73773@lists.php.net to get a copy of this message | ||
From: cmv@php.net
Operating system: Debian Linux 2.4.6-pre6
PHP version: 4.1.0
PHP Bug Type: *XML functions
Bug description: XMLRPC extension: wrong results?
[This is a copy of email sent to xmlrpc-epi mailing list, which hasn't been
answered yet.]
First off, I'm using PHP 4.1.0 with the built in XMLRPC extension (which I
assume is pretty much the same as what's documented at
http://xmlrpc-epi.sourceforge.net/)
I made a simple server which basically echo's back the same params that are
passed to it (see the script below).
It works when I send an integer, or a string, or an associative array.
However, it fails on a non-indexed array.
Am I doing something wrong, or is this a bug in the extension? I hope it's
me, because this extension is pretty damn cool. :)
- Colin
The script:
<?php
function method_echo($method, $params) {
$foo = array_pop($params);
return $foo;
}
/* this is the test data to send */
$data = array('bob','kim');
echo "<h1>Request</h1>";
echo "<xmp>";
var_dump($data);
echo "</xmp>";
$server = xmlrpc_server_create();
xmlrpc_server_register_method($server, 'method_echo', 'method_echo');
$request_xml = xmlrpc_encode_request('method_echo', $data );
$response = xmlrpc_server_call_method($server, $request_xml, NULL,
array(
'output_type' => 'php'
)
);
echo "<h1>Result</h1>";
echo "<xmp>";
var_dump($response);
echo "</xmp>";
xmlrpc_server_destroy($server);
?>
--
Edit bug report at: http://bugs.php.net/?id=14521&edit=1