Skip to content

Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error - #25367

Merged
TimWolla merged 1 commit into
php:PHP-8.4from
lacatoire:fix/curl-multi-pushfunction-argnum-8.4
Nov 10, 2026
Merged

TimWolla merged 1 commit into
php:PHP-8.4from
lacatoire:fix/curl-multi-pushfunction-argnum-8.4

Conversation

@lacatoire

@lacatoire lacatoire commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

curl_multi_setopt() names the wrong argument when the callback given for CURLMOPT_PUSHFUNCTION is invalid: the error says argument 2 ($option), but the callback is argument 3 ($value).

To reproduce

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

TypeError: curl_multi_setopt(): Argument #3 ($value) must be a valid callback for option CURLMOPT_PUSHFUNCTION, function "not a callable" not found or invalid function name

@TimWolla
TimWolla merged commit 8aea481 into php:PHP-8.4 Nov 10, 2026
18 checks passed
TimWolla added a commit that referenced this pull request Nov 10, 2026
* PHP-8.4:
  Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
  Fix the argument named by the imageaffine() element TypeError (#25369)
TimWolla added a commit that referenced this pull request Nov 10, 2026
* PHP-8.5:
  Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
  Fix the argument named by the imageaffine() element TypeError (#25369)
TimWolla added a commit that referenced this pull request Nov 10, 2026
* PHP-8.6:
  Fix argument number in curl_multi_setopt() CURLMOPT_PUSHFUNCTION error (#25367)
  Fix the argument named by the imageaffine() element TypeError (#25369)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants