Home
last modified time | relevance | path

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

/PHP-8.0/ext/standard/tests/array/
H A Darray_rand.phpt2 array_rand() tests
7 var_dump(array_rand(array()));
13 var_dump(array_rand(array(), 0));
19 var_dump(array_rand(array(1,2,3), 0));
25 var_dump(array_rand(array(1,2,3), -1));
31 var_dump(array_rand(array(1,2,3), 10));
36 var_dump(array_rand(array(1,2,3), 3));
37 var_dump(array_rand(array(1,2,3), 2));
41 array_rand(): Argument #1 ($array) cannot be empty
42 array_rand(): Argument #1 ($array) cannot be empty
[all …]
H A Darray_rand_variation5.phpt2 Test array_rand() function : usage variation - invalid values for 'req_num' parameter
6 * Test behaviour of array_rand() function when associative array and
11 echo "*** Testing array_rand() : with invalid values for 'req_num' ***\n";
21 // Testing array_rand() function with various invalid 'req_num' values
24 var_dump( array_rand($input) ); // with default $num_req value
26 var_dump( array_rand($input, 1) ); // with valid $num_req value
31 var_dump( array_rand($input, 0) ); // with $num_req=0
38 var_dump( array_rand($input, -1) ); // with $num_req=-1
45 var_dump( array_rand($input, -2) ); // with $num_req=-2
52 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
6 * Test array_rand() when array with default keys is passed to 'input' argument
9 echo "*** Testing array_rand() : array with default keys ***\n";
16 // Calling array_rand() with optional argument
18 var_dump( array_rand($input,$num_req) );
20 // Calling array_rand() with default arguments
22 var_dump( array_rand($input) );
27 *** 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
6 * Test array_rand() when associative array is passed to 'input' argument
9 echo "*** Testing array_rand() : with associative array ***\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() : with associative array ***
H A Darray_rand_variation3.phpt2 Test array_rand() function : usage variation - with MultiDimensional array
6 * Test behaviour of array_rand() function when multi-dimensional array
10 echo "*** Testing array_rand() : with multi-dimensional array ***\n";
40 // calling array_rand() function with multi-dimensional array
41 var_dump( array_rand($input, $num_req) );
43 // looping to test array_rand() with each sub-array in the multi-dimensional array
44 echo "\n*** Testing array_rand() with arrays having different types of values ***\n";
48 var_dump( array_rand($arr) ); // with default arguments
49 var_dump( array_rand($arr, 3) ); // with default as well as optional arguments
56 *** 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
6 * Test behaviour of array_rand() when keys of the 'input' array is heredoc string
9 echo "*** Testing array_rand() : with keys of input array as heredoc strings ***\n";
48 // Test array_rand() function with different valid 'req_num' values
50 var_dump( array_rand($input) );
53 var_dump( array_rand($input, 1) );
56 var_dump( array_rand($input, 3) );
59 var_dump( array_rand($input, 6) );
65 \*\*\* 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
6 * Test behaviour of array_rand() function when associative array is passed to
10 echo "*** Testing array_rand() : with associative arrays ***\n";
41 /* looping to test array_rand() function with different arrays having
50 var_dump( array_rand($input) );
54 var_dump( array_rand($input, 1) ); // with $num_req=1
56 var_dump( array_rand($input, 2) ); // with $num_req=2
65 \*\*\* 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-8.0/ext/standard/tests/file/
H A Duserstreams.phpt213 $whence = $whence_map[array_rand($whence_map, 1)];
/PHP-8.0/ext/standard/
H A Dbasic_functions.stub.php226 function array_rand(array $array, int $num = 1): int|string|array {} function
H A Dbasic_functions_arginfo.h2303 ZEND_FUNCTION(array_rand);
2928 ZEND_FE(array_rand, arginfo_array_rand)
H A Darray.c5668 PHP_FUNCTION(array_rand) argument

Completed in 81 milliseconds