Skip to content

Show curl option name in error message - #22908

Draft
Sjord wants to merge 4 commits into
php:masterfrom
Sjord:curl-error-option-name
Draft

Show curl option name in error message#22908
Sjord wants to merge 4 commits into
php:masterfrom
Sjord:curl-error-option-name

Conversation

@Sjord

@Sjord Sjord commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Retrieve the option name by using curl_easy_option_by_id or by walking zend_constants, depending on whether the curl version used has curl_easy_option_by_id.

Showing the option name is especially useful when using curl_setopt_array. A user may specify many options, and this change makes it clear which option is wrong exactly.

Related to #10097, #22705.

Sjord added 4 commits July 28, 2026 12:02
Use curl_easy_option_by_id to retrieve the name of the option, and also
show the name of the option in the case where strings contain a null
byte.

curl_easy_option_by_id simplifies the code, but was introduced in curl
7.73.0, so this also bumps the minimum version of curl. 7.73.0 was
released in 2020, so I think that's acceptable.

Showing the option name is especially useful when using
curl_setopt_array. A user may specify many options, and this change
makes it clear which option is wrong exactly.
@Sjord

Sjord commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@GrahamCampbell What do you think about this fallback in case curl_easy_option_by_id is not available?

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.

1 participant