php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38445 xmlrpc_decode/decode_request Return Type
Submitted: 2006-08-14 00:54 UTC Modified: 2007-01-22 02:46 UTC
From: schow at macnexus dot org Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: schow at macnexus dot org
New email:
PHP Version: OS:

 

 [2006-08-14 00:54 UTC] schow at macnexus dot org
Description:
------------
In the manual, the return type for xmlrpc_decode and xmlrpc_decode_request should really be "mixed" and not "array." 

If the service return is an array, struct, or multiple values, then yes, an array is returned.

However, if just one scalar value is returned (see code example) xmlrpc_decode will return just one string ("Hello!").  


Reproduce code:
---------------
$xml1 = "<?xml version=\"1.0\"?>
<methodResponse>
<params><param><value><struct>
<member><name>One</name><value><string>2</string></value></member>
</struct></value></param></params>
</methodResponse>";

$xml2 = "<?xml version=\"1.0\"?>
<methodResponse>
<params><param><value>
<string>Hello!</string>
</value></param></params>
</methodResponse>";

$data1 = xmlrpc_decode($xml1);
$data2 = xmlrpc_decode($xml2);

echo gettype($data1);
echo gettype($data2);

Expected result:
----------------
PHP executes the code correctly.  In the code, $data1 is the returned value of xmlrpc_decode for an xmlrpc struct.  gettype reports $data1 as an array.  $data2 is the returned value of an xml-rpc string scalar.  gettype reports it as a string.



Actual result:
--------------
The documentation should be changed to "mixed" to indicate that xmlrpc_decode will not always return an array.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-22 02:46 UTC] didou@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Nov 20 18:00:01 2025 UTC