|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-05 15:15 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 12:00:01 2025 UTC |
Description: ------------ wddx_deserialize/wddx_unserialize does not deserialize the array keys correctly Array with the following keys will not deserialize correctly in PHP 5.2.1 & 5.2.2 but did deserialize correctly in PHP4 array('1.1' => 'One 1','1.2' => 'One 2') array keys will become 1 and therefor the 2nd key 1.2 will overwrite the first key 1.1 Reproduce code: --------------- <?php $data = array( 'somearray' => array('1.1' => 'One 1','1.2' => 'One 2') ); echo "<pre>Should be:\n"; var_dump(array('data'=>$data)); echo '</pre>'; echo "<pre>Is:\n"; var_dump(wddx_deserialize(wddx_serialize_vars('data'))); echo '</pre>'; ?> Expected result: ---------------- array(1) { ["data"]=> array(1) { ["somearray"]=> array(2) { ["1.1"]=> string(5) "One 1" ["1.2"]=> string(5) "One 2" } } } Actual result: -------------- array(1) { ["data"]=> array(1) { ["somearray"]=> array(1) { [1]=> string(5) "One 2" } } }