Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ function split(ReadableStream $source, string $delimiter, ?Cancellation $cancell
$split = \explode($delimiter, $buffer);
$buffer = \array_pop($split);

yield from $split;
// Don't use yield from to avoid reusing the keys from $split
foreach ($split as $v) {
yield $v;
}
}

if ($buffer !== '') {
Expand Down