[php-src] PR #25367: Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error
| From: | lacatoire | Date: | Tue, 10 Nov 2026 13:11:27 +0000 |
| Subject: | [php-src] PR #25367: Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40506@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25367
Author: lacatoire
curl_multi_setopt() blames argument #2 ($option) when the callback given
for CURLMOPT_PUSHFUNCTION is invalid, but the callback is $value, argument
#3.
### To reproduce
```php
<?php
$mh = curl_multi_init();
try {
curl_multi_setopt($mh, CURLMOPT_PUSHFUNCTION, "not a callable");
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
```
Before (8.4.26 and 8.5.12): TypeError: curl_multi_setopt(): Argument #2 ($option) must be a
valid callback for option CURLMOPT_PUSHFUNCTION, function "not a callable" not found or
invalid function name
After: Argument #3 ($value) instead of Argument #2 ($option).