src/QCheck/FP.php
public static function takeNth($n, $coll)
    {
        $coll = self::iterator($coll);
        for ($coll->rewind(); $coll->valid(); $coll->valid() && $coll->next()) {
            yield $coll->current();
            for ($i = 0; $i < $n - 1 && $coll->valid(); ++$i) {
                $coll->next();
            }
        }
    }
public static function takeNth($n, $coll)
    {
        $coll = self::iterator($coll);
        for ($coll->rewind(); $coll->valid(); $coll->valid() && $coll->next()) {
            yield $coll->current();
            for ($i = 0; $i < $n - 1 && $coll->valid(); ++$i) {
                $coll->next();
            }
        }
    }
public static function takeNth ( $ n , $ coll ) { $ coll = self :: iterator ( $ coll ) ; for ( $ coll -> rewind ( ) ; $ coll -> valid ( ) ; $ coll -> valid ( ) && $ coll -> next ( ) ) { yield $ coll -> current ( ) ; for ( $ i = 0 ; $ i < $ n - 1 && $ coll -> valid ( ) ; ++ $ i ) { $ coll -> next ( ) ; } } }
Return every Nth elements in the given collection in a lazy
fashion.

@param int $n
@param $coll
@return \Generator
Return every Nth elements in the given collection in a lazy fashion .