Fix deprecated curl_close() warning on PHP 8.5+#194
Open
semhoun wants to merge 3 commits intophptg:masterfrom
Open
Fix deprecated curl_close() warning on PHP 8.5+#194semhoun wants to merge 3 commits intophptg:masterfrom
semhoun wants to merge 3 commits intophptg:masterfrom
Conversation
vjik
requested changes
Apr 10, 2026
ff3daea to
1c86272
Compare
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.
Summary
Fixes the deprecation warning
Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0that appears when running on PHP 8.5 or higher.Problem
Since PHP 8.0, cURL handles (
CurlHandleobjects) are automatically closed when they are no longer referenced or when the script ends. The explicitcurl_close()function call became redundant.In PHP 8.5,
curl_close()is officially deprecated and emits a warning:Solution
Add a version check to only call
curl_close()on PHP versions older than 8.0:Backward Compatibility
This change maintains full backward compatibility:
curl_close()is called as before (required for resource cleanup)