skip() public method

This method discards the first few elements from the stream, maintaining key => value relations.
public skip ( integer $toSkip ) : Stream
$toSkip integer
return Stream
Beispiel #1
0
 public function testToArray()
 {
     $stream = new Stream([1, 2, 3, 4, 5, 6]);
     $result = $stream->skip(4)->toArray();
     $this->assertEquals([4 => 5, 5 => 6], $result);
     $this->assertEquals([5, 6], $stream->skip(4)->toArray(false));
 }