ID: 50282 Updated by: [email protected] Reported By: basicer at basicer dot com -Status: Open +Status: Closed Bug Type: XMLRPC-EPI related Operating System: Linux PHP Version: 5.2.11 -Assigned To: +Assigned To: felipe New Comment:
This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2009-11-24 11:32:32] [email protected] Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=291260 Log: - Fixed bug #50282 (xmlrpc_encode_request() changes object into array in calling function) ------------------------------------------------------------------------ [2009-11-24 10:35:16] basicer at basicer dot com 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 this bug report at http://bugs.php.net/?id=50282&edit=1
