range() public static method

Generates a sequence of integral numbers within a specified range.
public static range ( $start, $count ) : Linq
$start The value of the first integer in the sequence.
$count The number of sequential integers to generate.
return Linq An sequence that contains a range of sequential int numbers.
Example #1
0
 public function testRange_returnsRangeOfIntegers()
 {
     $range = Linq::range(0, 3)->toArray();
     $this->assertEquals(3, count($range));
     $this->assertEquals(0, $range[0]);
     $this->assertEquals(1, $range[1]);
     $this->assertEquals(2, $range[2]);
     $range = Linq::range(6, 3)->toArray();
     $this->assertEquals(3, count($range));
     $this->assertEquals(6, $range[0]);
     $this->assertEquals(7, $range[1]);
     $this->assertEquals(8, $range[2]);
     $range = Linq::range(-3, 5)->toArray();
     $this->assertEquals(5, count($range));
     $this->assertEquals(-3, $range[0]);
     $this->assertEquals(-2, $range[1]);
     $this->assertEquals(-1, $range[2]);
     $this->assertEquals(0, $range[3]);
     $this->assertEquals(1, $range[4]);
 }