HH\Vector::shuffle

Description

public function shuffle(): void

Shuffles the values of the current Vector randomly in place.

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Vector\Shuffle;

$v = Vector {'red', 'green', 'blue', 'yellow'};

// Randomize the Vector elements in place
$v->shuffle();

var_dump($v);
Output
object(HH\Vector)#1 (4) {
  [0]=>
  string(4) "blue"
  [1]=>
  string(3) "red"
  [2]=>
  string(6) "yellow"
  [3]=>
  string(5) "green"
}