Skip to content

fix: remove the curl_close() call deprecated in PHP 8.5 - #3

Merged
drkjc merged 1 commit into
mainfrom
remove-deprecated-curl-close
Oct 21, 2026
Merged

drkjc merged 1 commit into
mainfrom
remove-deprecated-curl-close

Conversation

@drkjc

@drkjc drkjc commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Remove curl_close(), which PHP 8.5 deprecates and which has had no effect since PHP 8.0 (the handle is freed when it goes out of scope). On PHP 8.5 every request triggered a deprecation notice, and with display_errors on, the notice was written into the response before the caller's output.
  • Test on PHP 8.5 in CI.
  • PHPUnit fails on deprecations, warnings and notices, so a new deprecation fails CI instead of passing with a note.

@drkjc
drkjc requested review from Samy-O7, ashkan-spreedly and britth and a balanced review from Copilot October 19, 2026 19:32

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 changes are compatible with the supported PHP versions, existing tests cover request handling, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Removes a deprecated cURL call from the SDK’s request handling and strengthens PHP compatibility checks.

Changes:

  • Remove curl_close(), relying on automatic handle cleanup.
  • Add PHP 8.5 to CI.
  • Make PHPUnit fail on deprecations, warnings, and notices.
File Description
src/​Utilities.php Removes the deprecated curl_close() call.
phpunit.xml Enables failure on runtime diagnostics.
.github/​workflows/​ci.yml Adds PHP 8.5 to the test matrix.

Review effort: Balanced

@Samy-O7 Samy-O7 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.

Approving. Dropping curl_close() is safe: since PHP 8.0 the handle is a CurlHandle object that's freed when it goes out of scope, and on PHP 8.5 the deprecation notice could end up in the response when display_errors is on. CI now covers PHP 8.2 through 8.5, and failing PHPUnit on deprecations, warnings and notices will catch the next one early.

@drkjc
drkjc merged commit d867ea8 into main Oct 21, 2026
7 checks passed
@drkjc
drkjc deleted the remove-deprecated-curl-close branch October 21, 2026 17:27
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.

3 participants