curl_multi_exec: Passing null to parameter $still_running of type int is deprecated - why only on some environments?

Viewed 266

We are using https://github.com/ezimuel/ringphp in a Magento 2 package (elasticsuite) which was working fine on our CI (PHP 8.1.7, Ubuntu docker container).

Now on staging, we are getting deprecation warnings.

https://github.com/ezimuel/ringphp/blob/1c444ad129861e70dc0fb00a2b9ed7f1d7c4b953/src/Client/CurlMultiHandler.php#L133

We can reproduce this with the n98-magerun2 dev console:

n98-magerun2 dev:con

>>> $foo = curl_multi_init(); $still_running = null; curl_multi_exec($foo, 
$still_running);
PHP Deprecated:  curl_multi_exec(): Passing null to parameter #2 ($still_running) of 
type int is deprecated in phar:///usr/local/bin/n98-magerun2eval()'d code on line 3
>>> echo error_reporting();
32767⏎

Error reporting is the same on both machines - why does this sometimes break and sometimes work flawlessly ? What else can be different?

Workaround for the problem itself seems

if ($this->active === null) $this->active = 0;

above that line.

https://github.com/ezimuel/ringphp/pull/6

0 Answers
Related