Home
last modified time | relevance | path

Searched refs:array_map (Results 1 – 25 of 46) sorted by relevance

12

/PHP-5.4/ext/standard/tests/array/
H A Darray_map_error.phpt2 Test array_map() function : error conditions
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
10 echo "*** Testing array_map() : error conditions ***\n";
13 echo "\n-- Testing array_map() function with Zero arguments --\n";
14 var_dump( array_map() );
16 // Testing array_map with one less than the expected number of arguments
21 var_dump( array_map('callback1') );
28 var_dump( array_map('callback2', $arr1) );
33 var_dump( array_map('callback2', $arr1, $arr2, $arr3) );
38 *** Testing array_map() : error conditions ***
[all …]
H A Darray_map_variation18.phpt2 Test array_map() function : usage variations - unexpected values for 'arr1' argument
11 * Test array_map() by passing non array values in place of $arr1
14 echo "*** Testing array_map() : unexpected values for 'arr1' ***\n";
97 var_dump( array_map('callback', $unexpected_inputs[$count]));
104 *** Testing array_map() : unexpected values for 'arr1' ***
107 Warning: array_map(): Argument #2 should be an array in %s on line %d%d
111 Warning: array_map(): Argument #2 should be an array in %s on line %d%d
115 Warning: array_map(): Argument #2 should be an array in %s on line %d%d
119 Warning: array_map(): Argument #2 should be an array in %s on line %d%d
123 Warning: array_map(): Argument #2 should be an array in %s on line %d%d
[all …]
H A Darray_map_variation17.phpt2 Test array_map() function : usage variations - unexpected values for 'callback' argument
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing different scalar/nonscalar values in place of $callback
14 echo "*** Testing array_map() : unexpected values for 'callback' argument ***\n";
67 // loop through each element of $inputs to check the behavior of array_map
70 var_dump( array_map($unexpected_callbacks[$count], $arr1));
77 *** Testing array_map() : unexpected values for 'callback' argument ***
80 Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on …
84 Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on …
88 Warning: array_map() expects parameter 1 to be a valid callback, no array or string given in %s on …
[all …]
H A Darray_map_variation14.phpt2 Test array_map() function : usage variations - null value for 'callback' argument
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
15 echo "*** Testing array_map() : null value for 'callback' argument ***\n";
26 /* calling array_map() with null callback */
29 var_dump( array_map(null, $arr1, $arr2, $arr3) );
30 var_dump( array_map(NULL, $arr1, $arr2, $arr3) );
33 var_dump( array_map(@$unset_var, $arr1, $arr2, $arr3) );
36 var_dump( array_map(@$undefined_var, $arr1) );
39 var_dump( array_map("", $arr1, $arr2) );
42 var_dump( array_map(array(), $arr1, $arr2) );
[all …]
H A Darray_map_variation1.phpt2 Test array_map() function : usage variations - string keys
6 /* Prototype : array array_map(mixed callback, array input1 [, array input2 ,...])
13 echo "*** Testing array_map() : string keys ***\n";
18 var_dump( array_map("cb1", $arr));
19 var_dump( array_map("cb2", $arr,$arr));
20 var_dump( array_map(null, $arr));
21 var_dump( array_map(null, $arr, $arr));
26 *** Testing array_map() : string keys ***
H A Darray_map_variation7.phpt2 Test array_map() function : usage variations - arrays of different size
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing array having different size
19 echo "*** Testing array_map() : arrays with diff. size ***\n";
26 // calling array_map with different arrays
27 var_dump( array_map('callback', array(1, 2, 3), array()) );
28 var_dump( array_map('callback', array(), array('a', 'b', 'c')) );
29 var_dump( array_map('callback', array(1, 2, 3), array('a', 'b')) );
30 var_dump( array_map('callback', array(012, 0x2F, 0X1A), array(2.3, 12.4e2)) );
31 var_dump( array_map('callback', array(), array(1, 2, 3), array('a', 'b')) ); // passing more no. o…
[all …]
H A Darray_map_variation16.phpt2 Test array_map() function : usage variations - failing built-in functions & language constructs
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing non-permmited built-in functions and language constructs i.e.
15 echo "*** Testing array_map() : non-permmited built-in functions ***\n";
34 var_dump( array_map($callback_names[$count], $arr1) );
40 *** Testing array_map() : non-permmited built-in functions ***
43 Warning: array_map() expects parameter 1 to be a valid callback, function 'echo' not found or inval…
47 Warning: array_map() expects parameter 1 to be a valid callback, function 'array' not found or inva…
51 Warning: array_map() expects parameter 1 to be a valid callback, function 'empty' not found or inva…
55 Warning: array_map() expects parameter 1 to be a valid callback, function 'eval' not found or inval…
[all …]
H A Darray_map_variation11.phpt2 Test array_map() function : usage variations - with recursive callback
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing subarrays and recursive callback function
14 echo "*** Testing array_map() : recursive callback function ***\n";
19 return array_map('square_recur_single_array', $var);
25 var_dump( array_map('square_recur_single_array', $array1));
30 *** Testing array_map() : recursive callback function ***
H A Darray_map_variation15.phpt2 Test array_map() function : usage variations - non existent 'callback' function
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing non existent function for $callback argument
14 echo "*** Testing array_map() : non existent 'callback' function ***\n";
21 var_dump( array_map('non_existent', $arr1, $arr2, $arr3) );
26 *** Testing array_map() : non existent 'callback' function ***
28 Warning: array_map() expects parameter 1 to be a valid callback, function 'non_existent' not found …
H A Darray_map_object2.phpt2 Test array_map() function : object functionality - with non-existent class and method
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Testing array_map() for following object functionalities:
15 echo "*** Testing array_map() : with non-existent class and method ***\n";
29 var_dump( array_map(array('non-existent', 'square'), array(1, 2)) );
32 var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) );
37 *** Testing array_map() : with non-existent class and method ***
40 Warning: array_map() expects parameter 1 to be a valid callback, class 'non-existent' not found in …
44 Warning: array_map() expects parameter 1 to be a valid callback, class 'SimpleClass' does not have …
H A Darray_map_variation13.phpt2 Test array_map() function : usage variations - callback function with different return types
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing different callback function returning:
15 echo "*** Testing array_map() : callback with diff return value ***\n";
25 var_dump( array_map('callback_int', $array1, $array2));
32 var_dump( array_map('callback_string', $array1, $array2));
39 var_dump( array_map('callback_bool', $array1, $array2));
46 var_dump( array_map('callback_null', $array1));
53 var_dump( array_map('callback_without_ret', $array1));
58 *** Testing array_map() : callback with diff return value ***
H A Darray_map_variation12.phpt2 Test array_map() function : usage variations - built-in function as callback
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing buit-in function as callback function
14 echo "*** Testing array_map() : built-in function ***\n";
20 var_dump( array_map('pow', $array1, $array2));
23 var_dump( array_map('pow', $array1));
26 var_dump( array_map('echo', $array1));
31 *** Testing array_map() : built-in function ***
58 Warning: array_map() expects parameter 1 to be a valid callback, function 'echo' not found or inval…
H A Darray_map_basic.phpt2 Test array_map() function : basic functionality
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
10 echo "*** Testing array_map() : basic functionality ***\n";
29 var_dump( array_map('multiply', $arr1, $arr2) );
32 var_dump( array_map('square', $arr1) );
39 var_dump( array_map('concatenate', $arr1, $arr2) );
44 *** Testing array_map() : basic functionality ***
H A Darray_map_variation6.phpt2 Test array_map() function : usage variations - array having subarrays
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing array having different subarrays
14 echo "*** Testing array_map() : array having subarrays ***\n";
30 var_dump( array_map('callback', $arr1));
34 *** Testing array_map() : array having subarrays ***
H A Darray_map_object3.phpt2 Test array_map() function : object functionality - class methods as callback function
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Testing array_map() for object functionality with following callback function variations:
17 echo "*** Testing array_map() : class methods as callback function ***\n";
51 var_dump( array_map(array('ChildClass', 'staticParent1'), $arr1) );
54 var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) );
57 var_dump( array_map(array($childobj, 'staticParent1'), $arr1) );
60 var_dump( array_map(array($parentobj, 'staticChild'), $arr1) );
65 *** Testing array_map() : class methods as callback function ***
77 Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have …
[all …]
H A Darray_map_variation10.phpt2 Test array_map() function : usage variations - anonymous callback function
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing anoymous callback function with following variations
14 echo "*** Testing array_map() : anonymous callback function ***\n";
20 var_dump( array_map( create_function('$a, $b', 'return array($a, $b);'), $array1, $array2));
23 var_dump( array_map( create_function('$a, $b', 'return array($a, $b);'), $array1));
26 var_dump( array_map( create_function(NULL, 'return NULL;'), $array1));
29 var_dump( array_map( create_function('$a', NULL), $array1));
32 var_dump( array_map( create_function('$a', 'return array($a);'), NULL));
37 *** Testing array_map() : anonymous callback function ***
[all …]
H A Darray_map_variation8.phpt2 Test array_map() function : usage variations - array with references
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing array having reference values for $arr1 argument
14 echo "*** Testing array_map() : array with references for 'arr1' argument ***\n";
42 var_dump( array_map('callback1', $arr1) );
45 var_dump( array_map('callback_cat', $arr1, $arr1) );
50 *** Testing array_map() : array with references for 'arr1' argument ***
H A Darray_map_variation19.phpt2 Test array_map() function : usage variations - callback pass semantics
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() with a pass-by-value callback forced to behave as a pass-by-reference function.
21 array_map('callback', $arr1);
25 array_map("callback", $arr2);
H A Darray_map_variation2.phpt2 Test array_map() function : usage variations - references
6 /* Prototype : array array_map(mixed callback, array input1 [, array input2 ,...])
11 echo "*** Testing array_map() : references ***\n";
17 var_dump( array_map("cb1", $arr));
18 var_dump( array_map("cb2", $arr,$arr));
19 var_dump( array_map(null, $arr));
20 var_dump( array_map(null, $arr, $arr));
30 *** Testing array_map() : references ***
H A Darray_map_variation9.phpt2 Test array_map() function : usage variations - binary safe checking
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing array having binary values for $arr1 argument
14 echo "*** Testing array_map() : array with binary data for 'arr1' argument ***\n";
29 var_dump( array_map('callback1', $arr1) );
32 var_dump( array_map(b"callback2", $arr1) );
37 *** Testing array_map() : array with binary data for 'arr1' argument ***
H A Dbug35821.phpt2 Bug #35821 (array_map() segfaults when exception is throwed from the callback)
20 array_map(array('Element', 'CallBack'), $arr);
26 Warning: array_map(): An error occurred while invoking the map callback in %s on line %d
32 #2 %s(%d): array_map(Array, Array)
H A Darray_map_object1.phpt2 Test array_map() function : usage variations - object functionality
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Testing array_map() for object functionalities:
19 echo "*** Testing array_map() : object functionality ***\n";
31 var_dump(array_map($cb, $args));
126 *** Testing array_map() : object functionality ***
141 Warning: array_map() expects parameter 1 to be a valid callback, cannot access private method Simpl…
147 Warning: array_map() expects parameter 1 to be a valid callback, cannot access protected method Sim…
153 Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two member…
192 Warning: array_map() expects parameter 1 to be a valid callback, cannot access private method Stati…
[all …]
H A Darray_map_001.phpt2 array_map() and exceptions in the callback
13 array_map("foo", $a, array(2,3));
21 Warning: array_map(): An error occurred while invoking the map callback in %s on line %d
H A Darray_map_variation5.phpt2 Test array_map() function : usage variations - associative array with different values
5 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
11 * Test array_map() by passing associative array with different values for $arr1 argument
14 echo "*** Testing array_map() : associative array with diff. values for 'arr1' argument ***\n";
69 // loop through the various elements of $arrays to test array_map()
73 var_dump( array_map('callback', $arr1) );
80 *** Testing array_map() : associative array with diff. values for 'arr1' argument ***
/PHP-5.4/Zend/tests/
H A Dbug45744.phpt7 var_dump(array_map(array($this, 'callback'), $data));
14 return array_map(array($this, 'callback'), $value);
25 var_dump(array_map(array($this, 'callBack'), $data));

Completed in 42 milliseconds

12