Fix curl_close() deprecation in PHP 8.5#254
Merged
Conversation
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix curl_close usage in PHP 8.5 and above
Fix curl_close() deprecation in PHP 8.5
Jan 10, 2026
Member
|
@copilot Add a line for CHANGELOG. |
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Contributor
Author
Added CHANGELOG entry in commit 4a9f466. |
There was a problem hiding this comment.
Pull request overview
This PR addresses PHP 8.5 deprecation warnings for curl_close() and curl_multi_close() functions by adding version checks to conditionally call these functions only on PHP versions prior to 8.5.
Changes:
- Added
PHP_VERSION_ID < 80500conditional checks beforecurl_close()andcurl_multi_close()calls - Updated CHANGELOG.md to document the bug fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/CurlTransport.php | Added version checks to prevent deprecation warnings in PHP 8.5+ for curl_close() in send() method and curl_multi_close() in batchSend() method |
| CHANGELOG.md | Added entry documenting the fix for issue #253 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix PHP 8.5 curl_close deprecation
Summary
Fixed PHP 8.5 deprecation by conditionally calling
curl_close()andcurl_multi_close()only on PHP versions < 8.5. These functions are deprecated in PHP 8.5 because CurlHandle objects are automatically closed when they go out of scope (since PHP 8.0).Changes Made
PHP_VERSION_ID < 80500check beforecurl_close()call insend()methodPHP_VERSION_ID < 80500check beforecurl_multi_close()call inbatchSend()methodThis maintains backwards compatibility with older PHP versions while preventing deprecation warnings on PHP 8.5+.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.