shuffle() static public method

Shuffles an array and keeps the keys
static public shuffle ( array $array ) : array
$array array The source array
return array The shuffled result array
示例#1
0
 public function testShuffle()
 {
     $users = $this->users;
     $users = a::shuffle($users);
     // the only testable thing is that keys still exist
     $this->assertTrue(isset($users['userA']));
 }
示例#2
0
 function shuffle()
 {
     $this->_ = a::shuffle($this->_);
     return $this;
 }