From: basicer at basicer dot com
Operating system: Linux
PHP version: 5.2.11
PHP Bug Type: XMLRPC-EPI related
Bug description: xmlrpc_encode_request() changes object into array in calling
function
Description:
------------
Somehow calling xmlrpc_encode_request() will change an object into an
array even if the object is passed by reference to the function.
xmlrpc_encode_request() creates the correct XML in this case (a struct) but
corrupts the original object.
Reproduce code:
---------------
<?php
class One { var $x = 10; }
function go($name, $args) {
$x = xmlrpc_encode_request($name,$args);
}
$o = new One();
print "Start with an object...\n";
var_dump($o);
print "Do some stuff...\n";
go('test',array($o));
print "Now we have an array ?!\n";
var_dump($o);
Expected result:
----------------
Start with an object...
object(One)#1 (1) {
["x"]=>
int(10)
}
Do some stuff...
Now we have an array ?!
object(One)#1 (1) {
["x"]=>
int(10)
}
Actual result:
--------------
Start with an object...
object(One)#1 (1) {
["x"]=>
int(10)
}
Do some stuff...
Now we have an array ?!
array(1) {
["x"]=>
int(10)
}
--
Edit bug report at http://bugs.php.net/?id=50282&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50282&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50282&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50282&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50282&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50282&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50282&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50282&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50282&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50282&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50282&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50282&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50282&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50282&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50282&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50282&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50282&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50282&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50282&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50282&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50282&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50282&r=mysqlcfg