Collection::has PHP Method

has() public method

Checks if an element is in the collection by key.
public has ( string $key ) : boolean
$key string
return boolean
    public function has($key)
    {
        return isset($this->data[$key]);
    }

Usage Example

 public function testHasNotStrict()
 {
     $collection = new Collection(['1']);
     $this->assertTrue($collection->has('1', false));
     $this->assertTrue($collection->has(1, false));
     $this->assertFalse($collection->has(2, false));
 }
All Usage Examples Of Collection::has