Skip to content

Commit

Permalink
Fix zip() for PHP 5.5
Browse files Browse the repository at this point in the history
finally just doesn't work as expected in 5.5.
  • Loading branch information
trowski committed Feb 21, 2016
1 parent 0092679 commit c8fb02e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Observable/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,15 @@ function ($value) use (&$i, &$next, &$delayed, $key, $count, $emit) {
try {
yield Awaitable\choose($coroutines);
yield $delayed;
} finally {

foreach ($coroutines as $coroutine) {
$coroutine->cancel();
}
} catch (\Exception $exception) {
foreach ($coroutines as $coroutine) {
$coroutine->cancel($exception);
}
throw $exception;
}

yield $i; // Return the number of times a set was emitted.
Expand Down

0 comments on commit c8fb02e

Please sign in to comment.