1--TEST--
2Test array_map() function : usage variations - string keys
3--FILE--
4<?php
5
6/* Prototype  : array array_map(mixed callback, array input1 [, array input2 ,...])
7 * Description: Applies the callback to the elements in given arrays.
8 * Source code: ext/standard/array.c
9*/
10
11
12
13echo "*** Testing array_map() : string keys ***\n";
14
15$arr = array("stringkey" => "value");
16function cb1 ($a) {return array ($a);};
17function cb2 ($a,$b) {return array ($a,$b);};
18var_dump( array_map("cb1", $arr));
19var_dump( array_map("cb2", $arr,$arr));
20var_dump( array_map(null,  $arr));
21var_dump( array_map(null, $arr, $arr));
22echo "Done";
23?>
24
25--EXPECT--
26*** Testing array_map() : string keys ***
27array(1) {
28  ["stringkey"]=>
29  array(1) {
30    [0]=>
31    string(5) "value"
32  }
33}
34array(1) {
35  [0]=>
36  array(2) {
37    [0]=>
38    string(5) "value"
39    [1]=>
40    string(5) "value"
41  }
42}
43array(1) {
44  ["stringkey"]=>
45  string(5) "value"
46}
47array(1) {
48  [0]=>
49  array(2) {
50    [0]=>
51    string(5) "value"
52    [1]=>
53    string(5) "value"
54  }
55}
56Done