Lines Matching refs:array_rand
2 Test array_rand() function : usage variation - invalid values for 'req_num' parameter
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
47 *** Testing array_rand() : with invalid values for 'req_num' ***
57 Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array …
62 Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array …
67 Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array …
72 Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array …