Initialize a cURL session using a pooled curl handle


namespace HH;

function curl_init_pooled(
  string $poolName,
  ?string $url = null,
): mixed;

When this resource is garbage collected, the curl handle will be saved for reuse later. Pooled curl handles persist between requests.


  • string$poolName - The name of the connection pool to use. Named connection pools are initialized via the 'curl.namedPools' ini setting, which is a comma separated list of named pools to create, or at runtime with curl_create_pool.
  • string$url = null - If provided, the CURLOPT_URL option will be set to its value. You can manually set this using the curl_setopt() function. The file protocol is disabled by cURL if open_basedir is set.

Return Values

  • resource - - Returns a cURL handle on success, FALSE on errors.