remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_rand_basic2.php
bloba8166de9cbf1cbea077a8e862654ea2436b08c78
1 <?hh
2 /* Prototype : mixed array_rand(array $input [, int $num_req])
3 * Description: Return key/keys for random entry/entries in the array
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Test array_rand() when associative array is passed to 'input' argument
9 */
10 <<__EntryPoint>> function main(): void {
11 echo "*** Testing array_rand() : with associative array ***\n";
14 // Initialise the 'input' and 'num_req' variables
15 $input = array(
16 'one' => 1, 'two' => 2, 'three' => 3,
17 'FoUr' => 'four', '#5' => 5, 'SIX' => 'six',
18 "seven" => 7, "#8" => "eight", "nine" => "NINE"
21 $num_req = 6;
23 // Calling array_rand() with optional argument
24 echo"\n-- with all default and optional arguments --\n";
25 var_dump( array_rand($input,$num_req) );
27 // Calling array_rand() with default arguments
28 echo"\n-- with default argument --\n";
29 var_dump( array_rand($input) );
31 echo "Done";