|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2007-08-22 15:39 UTC] johannes@php.net
  [2007-08-22 16:42 UTC] neel dot basu dot z at gmail dot com
  [2007-08-22 18:37 UTC] neel dot get at gmail dot com
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
Description: ------------ If string indexed array is given to array_map it returns numerically indexed array after applying the callback. I am using PHP 5.2.1 on Debian Linux. Reproduce code: --------------- <?php $r = array('one' => 'HeLlO', 'two' => 'Hi'); print_r($r);//Orgiginal array $r = array_map('tst_it', $r, array(false)); function tst_it($r, $bool = false){ if($bool){return strtoupper($r);} else{return strtolower($r);} } print_r($r);//Array after array_map ?> Expected result: ---------------- Array ( [one] => HeLlO [two] => Hi ) Array ( [one] => hello [two] => hi ) Actual result: -------------- Array ( [one] => HeLlO [two] => Hi ) Array ( [0] => hello [1] => hi )