Lines Matching refs:array
2 Test array_combine() function : usage variations - associative array with different values(Bug#4342…
5 /* Prototype : array array_combine(array $keys, array $values)
6 * Description: Creates an array by using the elements of the first parameter as keys
8 * Source code: ext/standard/array.c
17 echo "*** Testing array_combine() : assoc array with diff values to both \$keys and \$values argume…
39 // different variations of associative array
40 $arrays = array (
42 // empty array
43 /*1*/ array(),
46 array('0' => 0),
47 array("1" => 1),
48 array("one" => 1, 'two' => 2, "three" => 3, 4 => 4),
51 /*5*/ array("float" => 2.3333),
52 array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333),
55 /*7*/ array(111 => "\tHello", "red" => "col\tor", 2 => "\v\fworld", 3.3 => "pen\n"),
56 array(111 => '\tHello', "red" => 'col\tor', 2 => '\v\fworld', 3.3 => 'pen\n'),
57 array(1 => "hello", "heredoc" => $heredoc),
59 // array with object, unset variable and resource variable
60 /*10*/ array(11 => new classA(), "unset" => @$unset_var, "resource" => $fp),
62 // array with mixed values
63 /*11*/ array(1 => 'hello', 2 => new classA(), 222 => "fruit",
69 // loop through each sub-array within $arrays to check the behavior of array_combine()
71 foreach($arrays as $array) {
73 var_dump( array_combine($array, $array) );
83 *** Testing array_combine() : assoc array with diff values to both $keys and $values argument ***
85 array(0) {
88 array(1) {
93 array(1) {
98 array(4) {
109 array(1) {
114 array(4) {
125 array(4) {
138 array(4) {
149 array(2) {
156 array(3) {
166 array(8) {