From:             
Operating system: win7
PHP version:      5.3.6
Package:          *General Issues
Bug Type:         Bug
Bug description:keys lost when replace an array 

Description:
------------
---
>From manual page: http://www.php.net/function.substr-replace%23Changelog
---
My version is 5.3.5.
But the keys lost when replace an array.
I wan't write more, but I can't. 
Oh, my poor English.
I'm Chinese.
Tank you.


Test script:
---------------
<?php

$arr = array('abc'=>'llsskdkk','def'=>'llsskjkkdd');
$newarr = substr_replace($arr, 'zzz', 0, -2);

print_r($newarr);

?>

Expected result:
----------------
Array
(
    [abc] => zzzkk
    [def] => zzzdd
)

Actual result:
--------------
Array
(
    [0] => zzzkk
    [1] => zzzdd
)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55366&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55366&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55366&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55366&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55366&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55366&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55366&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55366&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55366&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55366&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55366&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55366&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55366&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55366&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55366&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55366&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55366&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55366&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55366&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55366&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55366&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55366&r=mysqlcfg

Reply via email to