Search Results
Note: This function has no effect. Prior to PHP 8.0.0, this function was used to close the resource. Closes a cURL session and frees all resources. The cURL handle, handle, is also deleted.
Dec 4, 2025 · Before PHP 8.0, the function curl_close was used to close the Curl resource created by using the curl_init function. Since PHP 8.0, the curl_close function has no effect because curl_init returns the CurlHandle object instead of a resource. The CurlHandle is automatically closed when it is no longer referenced or when it is explicitly destroyed.
In PHP 8.0, the Curl extension migrated its resource objects to CurlHandle and CurlShareHandle objects as part of PHP's resource to object transformation. CurlHandle objects are created by the curl_init function, and prior to PHP 8.0, they can be closed using the curl_close function.
The PHP Client URL curl_close() function is used to close a cURL session and free all resources related with it. To use this function you need to initialize cURL session using curl_init().
Sep 24, 2025 · Since PHP 8.0, the cURL extension migrated from resources to objects (CurlHandle). With that shift, calling curl_close() stopped doing anything; the handle is released automatically when the CurlHandle object falls out of scope or is garbage-collected. PHP 8.5 formalizes this reality by deprecating curl_close(), with removal targeted for PHP 9.
Cette fonction n'a aucun effet. Antérieur à PHP 8.0.0, cette fonction était utilisé pour fermer une ressource. Ferme une session cURL et libère toutes les ressources réservées. L'identifiant cURL handle est aussi effacé.
People also ask
What is curl_close() function in PHP?
What is curl() function in PHP?
How to close a curl session in PHP?
How do I Close a curlhandle object in PHP?
Apr 11, 2025 · PHP curl_close function tutorial shows how to properly close cURL sessions in PHP. Learn curl_close with practical examples.
