Skip to content

Fix: prevent curl_close() deprecation on PHP 8.5#1042

Open
robinson-j16 wants to merge 1 commit intoFakerPHP:2.0from
robinson-j16:fix/php85-curl-deprecation
Open

Fix: prevent curl_close() deprecation on PHP 8.5#1042
robinson-j16 wants to merge 1 commit intoFakerPHP:2.0from
robinson-j16:fix/php85-curl-deprecation

Conversation

@robinson-j16
Copy link

What is the reason for this PR?

Author's checklist

Summary of changes

This PR addresses the curl_close() deprecation introduced in PHP 8.5. Since PHP 8.0, cURL handles are automatically managed objects, making explicit calls to curl_close() a no-op. Starting with PHP 8.5, calling this function triggers an E_DEPRECATED notice.

Changes included:

  • Wrapped curl_close() calls in src/Faker/Provider/Image.php with a PHP_VERSION_ID < 80000 check.
  • Updated the corresponding test in test/Faker/Provider/ImageTest.php to prevent deprecation warnings during test execution.
  • Verified that the fix maintains compatibility with PHP 7.4 through PHP 8.5.

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

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 close deprecated as of PHP 8.5

1 participant

Comments