randElement() 공개 정적인 메소드

Example: $array = array('john', 'city', 'small'); $rand = Arrays::randElement($array); Result: rand element from array
public static randElement ( array $elements ) : null
$elements array
리턴 null
예제 #1
0
 /**
  * @test
  */
 public function shouldReturnNullIfNotFindRandomElement()
 {
     //given
     $array = array();
     //when
     $result = Arrays::randElement($array);
     //then
     $this->assertNull($result);
 }