1--TEST-- 2Test array_map() function : usage variations - string keys 3--FILE-- 4<?php 5 6echo "*** Testing array_map() : string keys ***\n"; 7 8$arr = array("stringkey" => "value"); 9function cb1 ($a) {return array ($a);}; 10function cb2 ($a,$b) {return array ($a,$b);}; 11var_dump( array_map("cb1", $arr)); 12var_dump( array_map("cb2", $arr,$arr)); 13var_dump( array_map(null, $arr)); 14var_dump( array_map(null, $arr, $arr)); 15echo "Done"; 16?> 17--EXPECT-- 18*** Testing array_map() : string keys *** 19array(1) { 20 ["stringkey"]=> 21 array(1) { 22 [0]=> 23 string(5) "value" 24 } 25} 26array(1) { 27 [0]=> 28 array(2) { 29 [0]=> 30 string(5) "value" 31 [1]=> 32 string(5) "value" 33 } 34} 35array(1) { 36 ["stringkey"]=> 37 string(5) "value" 38} 39array(1) { 40 [0]=> 41 array(2) { 42 [0]=> 43 string(5) "value" 44 [1]=> 45 string(5) "value" 46 } 47} 48Done 49