php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48514 cURL extension uses same resource name for simple and multi APIs
Submitted: 2009-06-09 21:40 UTC Modified: 2009-06-12 20:52 UTC
From: wharmby at uk dot ibm dot com Assigned: felipe (profile)
Status: Closed Package: cURL related
PHP Version: 5.*, 6CVS (2009-06-10) OS: *
Private report: No CVE-ID: None
 [2009-06-09 21:40 UTC] wharmby at uk dot ibm dot com
Description:
------------
The cURL extension currently registers 2 resource types and instances of these resources are returned by the curl_init() and curl_multi_init() api's. 

However, it is not currently possible to programaticaly determine which type of curl resource a variable represents as get_resource_type() returns "curl" for both types of resource.

I expected to get a different names for each of the 2 resource types; e.g "curl" and "curl_multi"




Reproduce code:
---------------
<?php

$ch1 = curl_init();
var_dump($ch1);
var_dump(get_resource_type($ch1));

$ch2 = curl_multi_init();
var_dump($ch2);
var_dump(get_resource_type($ch2));

?>

Expected result:
----------------
resource(4) of type (curl)
string(4) "curl"
resource(5) of type (curl_multi)
string(4) "curl_multi"



Actual result:
--------------
resource(4) of type (curl)
string(4) "curl"
resource(5) of type (curl)
string(4) "curl"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-12 20:52 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.2, 5.3 and HEAD. Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 10:01:29 2024 UTC