Searched refs:array_rand (Results 1 – 14 of 14) sorted by relevance
/PHP-7.4/ext/standard/tests/array/ |
H A D | array_rand.phpt | 2 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 D | array_rand_variation5.phpt | 5 /* 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 D | array_rand_basic1.phpt | 2 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 D | bug48224.phpt | 2 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 D | array_rand_basic2.phpt | 2 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 D | array_rand_variation3.phpt | 2 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 D | array_rand_variation6.phpt | 2 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 D | bug74361.phpt | 2 Bug #74361: Compaction in array_rand() violates COW 7 var_dump(array_rand($array));
|
H A D | array_rand_variation4.phpt | 2 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 D | bug74361_2.phpt | 2 Bug #74361: Compaction in array_rand() violates COW (variation) 13 array_rand($array, 1);
|
/PHP-7.4/ext/standard/ |
H A D | php_array.h | 80 PHP_FUNCTION(array_rand);
|
H A D | basic_functions.c | 3377 PHP_FE(array_rand, arginfo_array_rand)
|
H A D | array.c | 5841 PHP_FUNCTION(array_rand) argument
|
/PHP-7.4/ext/standard/tests/file/ |
H A D | userstreams.phpt | 210 $whence = $whence_map[array_rand($whence_map, 1)];
|
Completed in 64 milliseconds