#45707 [Opn->Bgs]: http_get returns an empty string upon timeout, not false
| From: | bjori@php.net | Date: | Mon, 04 Aug 2008 14:11:51 +0000 |
| Subject: | #45707 [Opn->Bgs]: http_get returns an empty string upon timeout, not false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127578@lists.php.net to get a copy of this message | ||
ID: 45707
Updated by: bjori@php.net
Reported By: alangland at andyl56 dot com
-Status: Open
+Status: Bogus
Bug Type: HTTP related
Operating System: Windows XP
PHP Version: 5.2.6
New Comment:
http_get() is a part of the pecl/http extension
(http://pecl.php.net/package/pecl_http).
Any bugs against this extension should be filed in the pecl bug
tracker: http://pecl.php.net/bugs/report.php?package=pecl_http
Previous Comments:
------------------------------------------------------------------------
[2008-08-04 13:34:03] alangland at andyl56 dot com
Description:
------------
http_get is supposed to return false on connection timeout, but instead
it returns an empty string.
Reproduce code:
---------------
if (false === ($http = http_get('http://0.0.0.0/',
array('timeout' =>
15, 'connecttimeout' => 15)))) {
echo 'FALSE returned';
}
else {
var_dump($http);
}
Expected result:
----------------
FALSE returned
Actual result:
--------------
string(0) ""
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45707&edit=1