QueryPath\Options::has PHP Méthode

has() public static méthode

Returns true of the specified key is already overridden in this object.
public static has ( string $key )
$key string The key to search for.
    public static function has($key)
    {
        return array_key_exists($key, self::$options);
    }

Usage Example

 public function testQPMerge()
 {
     $options = array('test1' => 'val1', 'test2' => 'val2');
     $options2 = array('test1' => 'val3', 'test4' => 'val4');
     Options::set($options);
     Options::merge($options2);
     $results = Options::get();
     $this->assertTrue(Options::has('test4'));
     $this->assertEquals('val3', $results['test1']);
 }