Table of Contents

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

Introduction

The ext/curl extension define 3 different resource types :

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

Vote

Simple 50% +1 majority: “Should those functions be added in 7.1”. The voting began on Jun 9 and will close on Jun 23.

Should those functions should be added in 7.1
Real name Yes No
colinodell (colinodell)  
davey (davey)  
galvao (galvao)  
guilhermeblanco (guilhermeblanco)  
hywan (hywan)  
jgmdev (jgmdev)  
kalle (kalle)  
kguest (kguest)  
laruence (laruence)  
leigh (leigh)  
lstrojny (lstrojny)  
mariano (mariano)  
mbeccati (mbeccati)  
mike (mike)  
pierrick (pierrick)  
rasmus (rasmus)  
sammyk (sammyk)  
stas (stas)  
svpernova09 (svpernova09)  
tpunt (tpunt)  
trowski (trowski)  
zeev (zeev)  
zimt (zimt)  
Final result: 23 0
This poll has been closed.

Patches and Tests

Patch : https://github.com/php/php-src/pull/1896

Implementation

Merged into php-src for PHP 7.1: https://github.com/php/php-src/commit/3d71c1de7af6f41653addb7bb75dd37adc4e87b0

Documented: http://svn.php.net/viewvc/?view=revision&revision=342910