Skip to content

Add CURLINFO_SIZE_DELIVERED and the size_delivered key to curl_getinfo() return types - #6683

Merged
staabm merged 1 commit into
phpstan:2.3.xfrom
Amoifr:feature-15371-curl-size-delivered
Oct 9, 2026
Merged

staabm merged 1 commit into
phpstan:2.3.xfrom
Amoifr:feature-15371-curl-size-delivered

Conversation

@Amoifr

@Amoifr Amoifr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Closes phpstan/phpstan#15371

PHP 8.6 adds CURLINFO_SIZE_DELIVERED and a size_delivered key to the array returned by curl_getinfo() (php/php-src@fd8eaaf15, libcurl >= 8.20.0).

  • CURLINFO_SIZE_DELIVERED returns int|false, like the other options that need a recent libcurl (CURLINFO_POSTTRANSFER_TIME_T, CURLINFO_CONN_ID), following the convention from Update curl_getinfo() return types #4279.
  • size_delivered: int is added right after size_download, in the order php-src fills the array. Like conn_id or used_proxy, it is not gated on the PHP version.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation matches PHP 8.6 behavior and includes focused regression coverage.

0 open findings

What changed in this PR

Adds PHP 8.6 support for CURLINFO_SIZE_DELIVERED in curl_getinfo() type inference.

Changes:

  • Maps the new option to int|false.
  • Adds size_delivered: int to the full return array.
  • Adds direct-option and array-shape coverage.
File Description
src/​Type/​Php/​CurlGetinfoFunctionDynamicReturnTypeExtension.php Adds new option and array-key types.
tests/​PHPStan/​Analyser/​nsrt/​curl_getinfo.php Updates the expected full array shape.
tests/​PHPStan/​Analyser/​nsrt/​curl_getinfo_8.6.php Tests the PHP 8.6 constant.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@staabm
staabm merged commit df607f6 into phpstan:2.3.x Oct 9, 2026
773 of 962 checks passed
@staabm

staabm commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

curl_getinfo has new size_delivered key in PHP 8.6

4 participants