Skip to content

Commit

Permalink
Clear timer alarm in finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
bcremer authored and sebastianbergmann committed Jul 24, 2020
1 parent 722a15f commit b058753
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Invoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@ function (): void {
pcntl_alarm($timeout);

try {
$result = call_user_func_array($callable, $arguments);
} catch (Throwable $t) {
return call_user_func_array($callable, $arguments);
} finally {
pcntl_alarm(0);

throw $t;
}

pcntl_alarm(0);

return $result;
}

public function canInvokeWithTimeout(): bool
Expand Down

0 comments on commit b058753

Please sign in to comment.