src/Fusonic/Linq/Linq.php
public function take($count)
    {
        if ($count == 0) {
            return new Linq([]);
        }
        $innerIterator = $this->iterator;
        if (!($innerIterator instanceof \Iterator)) {
            // IteratorIterator wraps $this->iterator because it is Traversable but not an Iterator.
            // (see https://bugs.php.net/bug.php?id=52280)
            $innerIterator = new \IteratorIterator($innerIterator);
        }

        return new Linq(new \LimitIterator($innerIterator, 0, $count));
    }
public function take($count)
    {
        if ($count == 0) {
            return new Linq([]);
        }
        $innerIterator = $this->iterator;
        if (!($innerIterator instanceof \Iterator)) {
            // IteratorIterator wraps $this->iterator because it is Traversable but not an Iterator.
            // (see https://bugs.php.net/bug.php?id=52280)
            $innerIterator = new \IteratorIterator($innerIterator);
        }

        return new Linq(new \LimitIterator($innerIterator, 0, $count));
    }
public function take ( $ count ) { if ( $ count == 0 ) { return new Linq ( [ ] ) ; } $ innerIterator = $ this -> iterator ; if ( ! ( $ innerIterator instanceof \ Iterator ) ) { // IteratorIterator wraps $this->iterator because it is Traversable but not an Iterator. // (see https://bugs.php.net/bug.php?id=52280) $ innerIterator = new \ IteratorIterator ( $ innerIterator ) ; } return new Linq ( new \ LimitIterator ( $ innerIterator , 0 , $ count ) ) ; }
Returns a specified number of contiguous elements from the start of a sequence

@param int $count    The number of elements to return.
@return  Linq        A Linq object that contains the specified number of elements from the start.
Returns a specified number of contiguous elements from the start of a sequence