Home
last modified time | relevance | path

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

1234

/PHP-8.2/ext/standard/tests/array/
H A Darray_map_error.phpt2 Test array_map() function : error conditions
5 echo "*** Testing array_map() : error conditions ***\n";
7 // Testing array_map with one less than the expected number of arguments
8 echo "\n-- Testing array_map() function with one less than expected no. of arguments --\n";
13 var_dump( array_map('callback1') );
24 var_dump( array_map('callback2', $arr1) );
32 var_dump( array_map('callback2', $arr1, $arr2, $arr3) );
37 *** Testing array_map() : error conditions ***
39 -- Testing array_map() function with one less than expected no. of arguments --
40 Exception: array_map() expects at least 2 arguments, 1 given
[all …]
H A Darray_map_variation17.phpt2 Test array_map() function : usage variations - unexpected values for 'callback' argument
6 * Test array_map() by passing different scalar/nonscalar values in place of $callback
9 echo "*** Testing array_map() : unexpected values for 'callback' argument ***\n";
62 // loop through each element of $inputs to check the behavior of array_map
66 var_dump( array_map($unexpected_callbacks[$count], $arr1));
76 *** Testing array_map() : unexpected values for 'callback' argument ***
79 array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given
82 array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given
85 array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given
88 array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given
[all …]
H A Dbug77931.phpt2 Bug #77931: Warning for array_map mentions wrong type
7 array_map('trim', array(), 1);
12 array_map('trim', array(), array(), true);
17 array_map('trim', array(), array(), array(), null);
24 array_map(): Argument #3 must be of type array, int given
25 array_map(): Argument #4 must be of type array, bool given
26 array_map(): Argument #5 must be of type array, null given
H A Darray_map_variation7.phpt2 Test array_map() function : usage variations - arrays of different size
6 * Test array_map() by passing array having different size
14 echo "*** Testing array_map() : arrays with diff. size ***\n";
21 // calling array_map with different arrays
22 var_dump( array_map('callback', array(1, 2, 3), array()) );
23 var_dump( array_map('callback', array(), array('a', 'b', 'c')) );
24 var_dump( array_map('callback', array(1, 2, 3), array('a', 'b')) );
25 var_dump( array_map('callback', array(012, 0x2F, 0X1A), array(2.3, 12.4e2)) );
26 var_dump( array_map('callback', array(), array(1, 2, 3), array('a', 'b')) ); // passing more no. o…
31 *** Testing array_map() : arrays with diff. size ***
H A Darray_map_variation1.phpt2 Test array_map() function : usage variations - string keys
6 echo "*** Testing array_map() : string keys ***\n";
11 var_dump( array_map("cb1", $arr));
12 var_dump( array_map("cb2", $arr,$arr));
13 var_dump( array_map(null, $arr));
14 var_dump( array_map(null, $arr, $arr));
18 *** Testing array_map() : string keys ***
H A Darray_map_variation14.phpt2 Test array_map() function : usage variations - null value for 'callback' argument
6 * Test array_map() by passing null values for $callback argument and testing whether shortest
10 echo "*** Testing array_map() : null value for 'callback' argument ***\n";
21 /* calling array_map() with null callback */
24 var_dump( array_map(null, $arr1, $arr2, $arr3) );
25 var_dump( array_map(NULL, $arr1, $arr2, $arr3) );
28 var_dump( array_map(@$unset_var, $arr1, $arr2, $arr3) );
31 var_dump( array_map(@$undefined_var, $arr1) );
35 var_dump( array_map("", $arr1, $arr2) );
42 var_dump( array_map(array(), $arr1, $arr2) );
[all …]
H A Darray_map_variation16.phpt2 Test array_map() function : usage variations - failing built-in functions & language constructs
6 * Test array_map() by passing non-permmited built-in functions and language constructs i.e.
10 echo "*** Testing array_map() : non-permmited built-in functions ***\n";
30 var_dump( array_map($callback_names[$count], $arr1) );
39 *** Testing array_map() : non-permmited built-in functions ***
41 array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or…
43 array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found o…
45 array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found o…
47 array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or…
49 array_map(): Argument #1 ($callback) must be a valid callback or null, function "exit" not found or…
[all …]
H A Darray_map_variation11.phpt2 Test array_map() function : usage variations - with recursive callback
6 * Test array_map() by passing subarrays and recursive callback function
9 echo "*** Testing array_map() : recursive callback function ***\n";
13 return array_map('square_recur_single_array', $var);
19 var_dump( array_map('square_recur_single_array', $array1));
24 *** Testing array_map() : recursive callback function ***
H A Darray_map_variation12.phpt2 Test array_map() function : usage variations - built-in function as callback
6 * Test array_map() by passing buit-in function as callback function
9 echo "*** Testing array_map() : built-in function ***\n";
15 var_dump( array_map('pow', $array1, $array2));
19 var_dump( array_map('pow', $array1));
26 var_dump( array_map('echo', $array1));
34 *** Testing array_map() : built-in function ***
47 array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or…
H A Darray_map_variation10.phpt2 Test array_map() function : usage variations - anonymous callback function
6 * Test array_map() by passing anonymous callback function with following variations
9 echo "*** Testing array_map() : anonymous callback function ***\n";
15 var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1, $array2));
19 var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1));
25 var_dump( array_map( function() { return NULL; }, $array1));
28 var_dump( array_map( function($a) { }, $array1));
32 var_dump( array_map( function($a) { return array($a); }, NULL));
40 *** Testing array_map() : anonymous callback function ***
86 array_map(): Argument #2 ($array) must be of type array, null given
H A Darray_map_variation15.phpt2 Test array_map() function : usage variations - non existent 'callback' function
6 * Test array_map() by passing non existent function for $callback argument
9 echo "*** Testing array_map() : non existent 'callback' function ***\n";
17 var_dump( array_map('non_existent', $arr1, $arr2, $arr3) );
25 *** Testing array_map() : non existent 'callback' function ***
26 array_map(): Argument #1 ($callback) must be a valid callback or null, function "non_existent" not …
H A Darray_map_object2.phpt2 Test array_map() function : object functionality - with non-existent class and method
6 * Testing array_map() for following object functionalities:
10 echo "*** Testing array_map() : with non-existent class and method ***\n";
25 var_dump( array_map(array('non-existent', 'square'), array(1, 2)) );
32 var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) );
40 *** Testing array_map() : with non-existent class and method ***
42 array_map(): Argument #1 ($callback) must be a valid callback or null, class "non-existent" not fou…
44 array_map(): Argument #1 ($callback) must be a valid callback or null, class SimpleClass does not h…
H A Darray_map_variation13.phpt2 Test array_map() function : usage variations - callback function with different return types
6 * Test array_map() by passing different callback function returning:
10 echo "*** Testing array_map() : callback with diff return value ***\n";
20 var_dump( array_map('callback_int', $array1, $array2));
27 var_dump( array_map('callback_string', $array1, $array2));
34 var_dump( array_map('callback_bool', $array1, $array2));
41 var_dump( array_map('callback_null', $array1));
48 var_dump( array_map('callback_without_ret', $array1));
53 *** Testing array_map() : callback with diff return value ***
H A Dbug74345.phpt14 array_map($cb, []);
15 array_map($cb, [], []);
17 array_map($cb, null);
22 array_map($cb, null, null);
43 array_map(): Argument #2 ($array) must be of type array, null given
44 array_map(): Argument #2 ($array) must be of type array, null given
H A Darray_map_basic.phpt2 Test array_map() function : basic functionality
5 echo "*** Testing array_map() : basic functionality ***\n";
24 var_dump( array_map('multiply', $arr1, $arr2) );
27 var_dump( array_map('square', $arr1) );
34 var_dump( array_map('concatenate', $arr1, $arr2) );
39 *** Testing array_map() : basic functionality ***
H A Darray_map_variation6.phpt2 Test array_map() function : usage variations - array having subarrays
6 * Test array_map() by passing array having different subarrays
9 echo "*** Testing array_map() : array having subarrays ***\n";
25 var_dump( array_map('callback', $arr1));
29 *** Testing array_map() : array having subarrays ***
H A Darray_map_variation8.phpt2 Test array_map() function : usage variations - array with references
6 * Test array_map() by passing array having reference values for $arr1 argument
9 echo "*** Testing array_map() : array with references for 'arr1' argument ***\n";
37 var_dump( array_map('callback1', $arr1) );
40 var_dump( array_map('callback_cat', $arr1, $arr1) );
45 *** Testing array_map() : array with references for 'arr1' argument ***
H A Darray_map_object3.phpt2 Test array_map() function : object functionality - class methods as callback function
6 * Testing array_map() for object functionality with following callback function variations:
12 echo "*** Testing array_map() : class methods as callback function ***\n";
46 var_dump( array_map(array('ChildClass', 'staticParent1'), $arr1) );
50 var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) );
56 var_dump( array_map(array($childobj, 'staticParent1'), $arr1) );
60 var_dump( array_map(array($parentobj, 'staticChild'), $arr1) );
68 *** Testing array_map() : class methods as callback function ***
79 array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not h…
90 array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not h…
H A Darray_map_variation19.phpt2 Test array_map() function : usage variations - callback pass semantics
6 * Test array_map() with a pass-by-value callback forced to behave as a pass-by-reference function.
16 array_map('callback', $arr1);
20 array_map("callback", $arr2);
H A Darray_map_variation2.phpt2 Test array_map() function : usage variations - references
6 echo "*** Testing array_map() : references ***\n";
11 var_dump( array_map("cb1", $arr));
12 var_dump( array_map(null, $arr));
13 var_dump( array_map(null, $arr, $arr));
22 *** Testing array_map() : references ***
H A Darray_map_variation9.phpt2 Test array_map() function : usage variations - binary safe checking
6 * Test array_map() by passing array having binary values for $arr1 argument
9 echo "*** Testing array_map() : array with binary data for 'arr1' argument ***\n";
24 var_dump( array_map('callback1', $arr1) );
28 var_dump( array_map(b"callback2", $arr1) );
36 *** Testing array_map() : array with binary data for 'arr1' argument ***
/PHP-8.2/Zend/tests/attributes/
H A D011_inheritance.phpt25 print_r(array_map(fn ($a) => $a->getName(), $ref->getAttributes()));
26 print_r(array_map(fn ($a) => $a->getName(), $ref->getMethod('foo')->getAttributes()));
29 print_r(array_map(fn ($a) => $a->getName(), $ref->getAttributes()));
30 print_r(array_map(fn ($a) => $a->getName(), $ref->getMethod('foo')->getAttributes()));
33 print_r(array_map(fn ($a) => $a->getName(), $ref->getAttributes()));
34 print_r(array_map(fn ($a) => $a->getName(), $ref->getMethod('foo')->getAttributes()));
57 print_r(array_map(fn ($a) => $a->getName(), $ref->getProperty('a')->getAttributes()));
60 print_r(array_map(fn ($a) => $a->getName(), $ref->getProperty('a')->getAttributes()));
63 print_r(array_map(fn ($a) => $a->getName(), $ref->getProperty('a')->getAttributes()));
/PHP-8.2/Zend/tests/
H A Dbug70895.phpt7 array_map("%n", 0);
12 array_map("%n %i", 0);
17 array_map("%n %i aoeu %f aoeu %p", 0);
23 array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or i…
24 array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found o…
25 array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu…
/PHP-8.2/ext/zend_test/tests/
H A Dobserver_backtrace_01.phpt21 return array_map(function ($value) {
76 <!-- init array_map() -->
78 array_map()
85 <array_map>
89 array_map()
101 array_map()
115 </array_map>
H A Dobserver_bug81430_2.phpt20 array_map("str_repeat", ["\xFF"], [100000000]); // cause a bailout
43 <!-- init array_map() -->
44 <array_map>
50 </array_map>

Completed in 17 milliseconds

1234