pierrick

Pierrick Charron

Contents

PHP RFC: Add curl_multi_errno(), curl_share_errno() and curl_share_strerror()

Introduction

The ext/curl extension define 3 different resource types :

  • cURL handle created by php curl_init()
  • cURL Multi Handle created by curl_multi_init()
  • cURL Share Handle created by curl_share_init()

As of today, it's possible to get the last error related to a cURL handle with the curl_errno() function, but there is no way to retrieve what was the last error related to a cURL Multi/Share handle.

Proposal

Add curl_multi_errno(), curl_share_errno() and curl_share_strerror() functions to get a consistent mechanism of error retrieval across all curl resource types.

Resource type init function last error error message
cURL handle curl_init() curl_errno() curl_strerror()
cURL Multi Handle curl_multi_init() curl_multi_errno() curl_multi_strerror()
cURL Share Handle curl_share_init() curl_share_errno() curl_share_strerror()

Functions in bold are the one that do not exists and that are be introduced in this RFC.

Functions signature

int curl_multi_errno(resource $mh);
int curl_share_errno(resource $rh);
string curl_share_strerror(int $errno);

Backward Incompatible Changes

None.

Proposed PHP Version(s)

7.1

Patches and Tests

Implementation

Votes

An option needs 50%+1 votes to win

Should those functions should be added in 7.1 (100% approved)
User Vote
colinodell Yes
davey Yes
galvao Yes
guilhermeblanco Yes
hywan Yes
jgmdev Yes
kalle Yes
kguest Yes
laruence Yes
leigh Yes
lstrojny Yes
mariano Yes
mbeccati Yes
mike Yes
pierrick Yes
rasmus Yes
sammyk Yes
stas Yes
svpernova09 Yes
tpunt Yes
trowski Yes
zeev Yes
zimt Yes