[PHP-BUG] Bug #51567 [NEW]: numerically indexed php arrays bug
[email protected] ("msbullshit at hotmail dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
From:
Operating system: OSX, FreeBSD
PHP version: 5.3.2
Package: *XML functions
Bug Type: Bug
Bug description:numerically indexed php arrays bug
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 bug report at http://bugs.php.net/bug.php?id=51567&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51567&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51567&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51567&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51567&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51567&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51567&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51567&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51567&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51567&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51567&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51567&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51567&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51567&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51567&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51567&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51567&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51567&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51567&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51567&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51567&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51567&r=mysqlcfg