Home
last modified time | relevance | path

Searched refs:array_rand (Results 1 – 14 of 14) sorted by relevance

/PHP-7.4/ext/standard/tests/array/
H A Darray_rand.phpt2 array_rand() tests
6 var_dump(array_rand());
7 var_dump(array_rand(array()));
8 var_dump(array_rand(array(), 0));
9 var_dump(array_rand(0, 0));
10 var_dump(array_rand(array(1,2,3), 0));
11 var_dump(array_rand(array(1,2,3), -1));
12 var_dump(array_rand(array(1,2,3), 10));
13 var_dump(array_rand(array(1,2,3), 3));
14 var_dump(array_rand(array(1,2,3), 2));
[all …]
H A Darray_rand_variation5.phpt5 /* Prototype : mixed array_rand(array $input [, int $num_req])
11 * Test behaviour of array_rand() function when associative array and
16 echo "*** Testing array_rand() : with invalid values for 'req_num' ***\n";
26 // Testing array_rand() function with various invalid 'req_num' values
29 var_dump( array_rand($input) ); // with default $num_req value
31 var_dump( array_rand($input, 1) ); // with valid $num_req value
35 var_dump( array_rand($input, 0) ); // with $num_req=0
37 var_dump( array_rand($input, -1) ); // with $num_req=-1
39 var_dump( array_rand($input, -2) ); // with $num_req=-2
41 var_dump( array_rand($input, 13) ); // with $num_req=13
[all …]
H A Darray_rand_basic1.phpt2 Test array_rand() function : basic functionality - array with default keys
5 /* Prototype : mixed array_rand(array $input [, int $num_req])
11 * Test array_rand() when array with default keys is passed to 'input' argument
14 echo "*** Testing array_rand() : array with default keys ***\n";
21 // Calling array_rand() with optional argument
23 var_dump( array_rand($input,$num_req) );
25 // Calling array_rand() with default arguments
27 var_dump( array_rand($input) );
32 *** Testing array_rand() : array with default keys ***
H A Dbug48224.phpt2 Bug #48224 (array_rand no longer shuffles)
6 $a1 = array_rand($a, count($a));
7 $a2 = array_rand($a, count($a));
8 $a3 = array_rand($a, count($a));
9 $a4 = array_rand($a, count($a));
H A Darray_rand_basic2.phpt2 Test array_rand() function : basic functionality - with associative array for 'input' argument
5 /* Prototype : mixed array_rand(array $input [, int $num_req])
11 * Test array_rand() when associative array is passed to 'input' argument
14 echo "*** Testing array_rand() : with associative array ***\n";
26 // Calling array_rand() with optional argument
28 var_dump( array_rand($input,$num_req) );
30 // Calling array_rand() with default arguments
32 var_dump( array_rand($input) );
37 *** Testing array_rand() : with associative array ***
H A Darray_rand_variation3.phpt2 Test array_rand() function : usage variation - with MultiDimensional array
5 /* Prototype : mixed array_rand(array $input [, int $num_req])
11 * Test behaviour of array_rand() function when multi-dimensional array
15 echo "*** Testing array_rand() : with multi-dimensional array ***\n";
45 // calling array_rand() function with multi-dimensional array
46 var_dump( array_rand($input, $num_req) );
48 // looping to test array_rand() with each sub-array in the multi-dimensional array
53 var_dump( array_rand($arr) ); // with default arguments
54 var_dump( array_rand($arr, 3) ); // with default as well as optional arguments
61 *** Testing array_rand() : with multi-dimensional array ***
[all …]
H A Darray_rand_variation6.phpt2 Test array_rand() function : usage variation - with heredoc string as key in the 'input' array
5 /* Prototype : mixed array_rand(array $input [, int $num_req])
11 * Test behaviour of array_rand() when keys of the 'input' array is heredoc string
14 echo "*** Testing array_rand() : with keys of input array as heredoc strings ***\n";
53 // Test array_rand() function with different valid 'req_num' values
55 var_dump( array_rand($input) );
58 var_dump( array_rand($input, 1) );
61 var_dump( array_rand($input, 3) );
64 var_dump( array_rand($input, 6) );
70 \*\*\* Testing array_rand\(\) : with keys of input array as heredoc strings \*\*\*
H A Dbug74361.phpt2 Bug #74361: Compaction in array_rand() violates COW
7 var_dump(array_rand($array));
H A Darray_rand_variation4.phpt2 Test array_rand() function : usage variation - with associative arrays for 'input' parameter
5 /* Prototype : mixed array_rand(array $input [, int $num_req])
11 * Test behaviour of array_rand() function when associative array is passed to
15 echo "*** Testing array_rand() : with associative arrays ***\n";
46 /* looping to test array_rand() function with different arrays having
55 var_dump( array_rand($input) );
59 var_dump( array_rand($input, 1) ); // with $num_req=1
61 var_dump( array_rand($input, 2) ); // with $num_req=2
70 \*\*\* Testing array_rand\(\) : with associative arrays \*\*\*
H A Dbug74361_2.phpt2 Bug #74361: Compaction in array_rand() violates COW (variation)
13 array_rand($array, 1);
/PHP-7.4/ext/standard/
H A Dphp_array.h80 PHP_FUNCTION(array_rand);
H A Dbasic_functions.c3377 PHP_FE(array_rand, arginfo_array_rand)
H A Darray.c5841 PHP_FUNCTION(array_rand) argument
/PHP-7.4/ext/standard/tests/file/
H A Duserstreams.phpt210 $whence = $whence_map[array_rand($whence_map, 1)];

Completed in 64 milliseconds