Pinq\ICollection::clear PHP Method

clear() public method

Removes all the values.
public clear ( ) : void
return void
    public function clear();

Usage Example

Example #1
0
 /**
  * @dataProvider everything
  */
 public function testThatSetIndexWithNoKeyAppendsTheValueWithTheNextLargestIntGreaterThanOrEqualToZeroLikeAnArray(\Pinq\ICollection $collection, array $data)
 {
     $collection->clear();
     $collection[-5] = 'foo';
     $collection[] = 'bar';
     $collection[7] = 'baz';
     $collection[] = 'qux';
     $this->assertSame('foo', $collection[-5]);
     $this->assertSame('bar', $collection[0]);
     $this->assertSame('baz', $collection[7]);
     $this->assertSame('qux', $collection[8]);
     unset($collection[8]);
     $this->assertFalse(isset($collection[8]));
     $collection[] = 'qux1';
     $this->assertSame('qux1', $collection[8]);
     unset($collection[8], $collection[7]);
     $collection[] = 'boo';
     $this->assertSame('boo', $collection[1]);
 }
All Usage Examples Of Pinq\ICollection::clear