|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46739 array returned by curl_getinfo should contain content_type key
Submitted: 2008-12-03 14:53 UTC Modified: 2008-12-04 13:15 UTC
From: thomas at koch dot ro Assigned:
Status: Closed Package: cURL related
PHP Version: 5.3CVS-2008-12-03 (CVS) OS: Debian Lenny
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: thomas at koch dot ro
New email:
PHP Version: OS:


 [2008-12-03 14:53 UTC] thomas at koch dot ro
The docu[1] states, that the array returned by curl_getinfo contains a key 'content_type'.
But this is not the case, if there has been a connection error.


Reproduce code:
$ch = curl_init('xyz');

curl_exec( $ch );
$curlInfo = curl_getinfo( $ch );
var_dump( $curlInfo['content_type'] );

Expected result:

Actual result:
Notice: Undefined index: content_type in /home/ymc-toko/curl_bug.php on line 7


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-04 13:15 UTC]
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
Thank you for the report, and for helping us make PHP better.

 [2009-07-26 02:12 UTC]
Automatic comment from SVN on behalf of rasmus
Log: The test for bug #46739 doesn't actually need the remote
responder, so get rid of the skipif in PHP 5, and it was
broken in PHP 6 because the keys in the curl_info array
were not unicode.  All internally-generated arrays should
have unicode keys.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 18 04:06:00 2022 UTC