async icon indicating copy to clipboard operation
async copied to clipboard

Return type of Spatie\Async\Pool::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool

Open gopibabus opened this issue 2 years ago • 2 comments

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: image

I hope this helps you. Please let me know if you need any further details. Thanks for your contribution.

gopibabus avatar May 20 '22 09:05 gopibabus

Same issue with PHP 8.1.7

alexongh avatar Jun 20 '22 21:06 alexongh

https://github.com/spatie/async/pull/184 would fix this issue

alexongh avatar Jun 20 '22 21:06 alexongh

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.

spatie-bot avatar Oct 21 '22 10:10 spatie-bot