#41469 [NEW]: err number key in array_slice

From: Date: Wed, 23 May 2007 08:55:29 +0000
Subject: #41469 [NEW]: err number key in array_slice
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112950@lists.php.net to get a copy of this message
From:             fallseir at gmail dot com
Operating system: linux
PHP version:      5.2.2
PHP Bug Type:     Unknown/Other Function
Bug description:  err number key in array_slice

Description:
------------
在数字和字母混合的键值数组中
数字key被重新排列了
use array_slice
array keys for number and string
the result is err!

Reproduce code:
---------------
$thisArray=array(1=>0,2=>31,"a9"=>1,"0"=>3,"abc"=>20);
print_r($thisArray);
$a2=array_slice($thisArray,0,100);
print_r($a2);

Expected result:
----------------
Array
(
    [1] => 0
    [2] => 31
    [a9] => 1
    [0] => 3
    [abc] => 20
)
Array
(
    [1] => 0
    [2] => 31
    [a9] => 1
    [0] => 3
    [abc] => 20
)

Actual result:
--------------
Array
(
    [1] => 0
    [2] => 31
    [a9] => 1
    [0] => 3
    [abc] => 20
)
Array
(
    [0] => 0
    [1] => 31
    [a9] => 1
    [2] => 3
    [abc] => 20
)

-- 
Edit bug report at http://bugs.php.net/?id=41469&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41469&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41469&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41469&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41469&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=41469&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41469&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41469&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41469&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41469&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41469&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=41469&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=41469&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41469&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41469&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41469&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41469&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41469&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41469&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41469&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41469&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#112950) next »