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: Bogus
Type: Bug
Package: *XML functions
Operating System: OSX, FreeBSD
PHP Version: 5.3.2
New Comment:
Ah, I see in the body of your report you say 5.3.1, but you have 5.3.2
in the
header. So yes, this was fixed in 5.3.2 as stated in the Changelog
http://www.php.net/ChangeLog-5.php#5.3.2
Previous Comments:
------------------------------------------------------------------------
[2010-04-16 06:11:32] [email protected]
You are not using PHP-5.3.2 then. This was fixed in that version. Just
verified
it here.
------------------------------------------------------------------------
[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.