|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-24 11:32 UTC] svn@php.net
[2009-11-24 11:32 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 01:00:02 2025 UTC |
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) }