Bug #51567 [Opn->Bgs]: numerically indexed php arrays bug

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=51567&edit=1

 ID:               51567
 Updated by:       [email protected]
 Reported by:      msbullshit at hotmail dot com
 Summary:          numerically indexed php arrays bug
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          *XML functions
 Operating System: OSX, FreeBSD
 PHP Version:      5.3.2

 New Comment:

You are not using PHP-5.3.2 then.  This was fixed in that version.  Just
verified 
it here.


Previous Comments:
------------------------------------------------------------------------
[2010-04-16 01:41:35] msbullshit at hotmail dot com

Description:
------------
Many people have complained about the indexed array bug already. Will
this bug 
ever be fixed?

The keys are lost if they have a numeric value even if they are set to
type 
string.

There was said that it wont be fixed:
http://bugs.php.net/21949
http://bugs.php.net/37746

There was said that it was fixed:
http://bugs.php.net/50285
http://phpxmlrpc.sourceforge.net/news.html

However it wasn't fixed. I still have the problem on PHP 5.3.1.

Test script:
---------------
<?
$a=array(1=>'one', '3'=>'three', 5=>'five', 'a'=>'foo');
print_r($a);
print_r(xmlrpc_decode(xmlrpc_encode($a)));
?>

Expected result:
----------------
Array
(
    [1] => one
    [3] => three
    [5] => five
    [a] => foo
)
Array
(
    [1] => one
    [3] => three
    [5] => five
    [a] => foo
)

Actual result:
--------------
Array
(
    [1] => one
    [3] => three
    [5] => five
    [a] => foo
)
Array
(
    [0] => one
    [1] => three
    [2] => five
    [a] => foo
)


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51567&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.