Skip to content

Commit

Permalink
How about this
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Nov 27, 2021
1 parent f9b4a24 commit e339b54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Standard.php
Expand Up @@ -39,6 +39,7 @@
use IteratorAggregate;
use function mt_getrandmax;
use function mt_rand;
use const PHP_VERSION_ID;
use Traversable;

/**
Expand Down Expand Up @@ -481,8 +482,11 @@ private static function take(Generator $input, int $take): Generator
}
}

// the break above will leave the generator in an inconsistent state
$input->next();
// @infection-ignore-all
if (PHP_VERSION_ID < 80000) {
// the break above will leave the generator in an inconsistent state
$input->next();
}
}

private static function tail(iterable $input, int $length): Generator
Expand Down

0 comments on commit e339b54

Please sign in to comment.