get() public static method

Will also do a case-insensitive search if a case sensitive search fails.
public static get ( string $key, array $values, mixed $default = null ) : mixed
$key string
$values array
$default mixed
return mixed
Ejemplo n.º 1
0
 public function testGetWillReturnDefaultValueIfKeyIsNotInArray()
 {
     $try = ['foo', 'bar', 'baz'];
     $array = ['quz' => true, 'quuz' => true];
     $default = 'BAT';
     foreach ($try as $key) {
         $this->assertSame($default, ServerRequestFactory::get($key, $array, $default));
     }
 }