|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
22 + 27 = ?
Subscribe to this entry?

 [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: Mon Aug 15 07:05:44 2022 UTC