async
async copied to clipboard
Return type of Spatie\Async\Pool::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool
Piece of code that I am trying to execute
use Spatie\Async\Pool;
$pool = Pool::create();
foreach (range(1, 5) as $i) {
$pool[] = async(function () {
usleep(random_int(10, 1000));
return 2;
})->then(function (int $output) {
$this->counter += $output;
});
}
await($pool);
Installed Version of PHP 8.0.*
Error Screenshot:
I hope this helps you. Please let me know if you need any further details. Thanks for your contribution.
Same issue with PHP 8.1.7
https://github.com/spatie/async/pull/184 would fix this issue
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.