#46739 [Opn->Csd]: array returned by curl_getinfo should contain content_type key

From: Date: Thu, 04 Dec 2008 13:15:21 +0000
Subject: #46739 [Opn->Csd]: array returned by curl_getinfo should contain content_type key
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131594@lists.php.net to get a copy of this message
ID: 46739 Updated by: mkoppanen@php.net Reported By: thomas at koch dot ro -Status: Open +Status: Closed Bug Type: cURL related Operating System: Debian Lenny PHP Version: 5.3CVS-2008-12-03 (CVS) New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2008-12-03 14:53:30] thomas at koch dot ro Description: ------------ 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. [1] http://www.php.net/manual/en/function.curl-getinfo.php Reproduce code: --------------- $ch = curl_init('xyz'); curl_exec( $ch ); $curlInfo = curl_getinfo( $ch ); var_dump( $curlInfo['content_type'] ); Expected result: ---------------- NULL Actual result: -------------- Notice: Undefined index: content_type in /home/ymc-toko/curl_bug.php on line 7 NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46739&edit=1

« previous php.bugs (#131594) next »