Closed alexdebril closed 4 years ago
Does this happen on dev-master?
It looks like this has already been fixed. A release is scheduled for tomorrow: https://github.com/guzzle/promises/pull/123.
Ho great, I saw the fix when I forked the project. Thanks for your reply, let's wait until tomorrow then.
Guzzle version(s) affected: 7.1.0 PHP version: 8.0.0-beta-4 (hint:
php --version
) cURL version: 7.64.0 (hint:php -i | grep cURL
)Description
Whereas it works fine with PHP <=7.4.* , using
Promise
to perform async calls with PHP 8.0 causes aTypeError
:How to reproduce
The code responsible for the call can be found here: https://github.com/alexdebril/feed-io/blob/master/src/FeedIo/Async/Reader.php#L64
The bug appears while running the unit tests, here's a part of the output:
Possible Solution
The culprit seems to be https://github.com/guzzle/promises/blob/master/src/EachPromise.php#L247
As it calls
resolve(null)
,Promise::settle()
finally tries to evaluatemethod_exists(null, 'then')
. A possible solution could be to test if$value
is not null before using inmethod_exists