php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45707 http_get returns an empty string upon timeout, not false
Submitted: 2008-08-04 13:34 UTC Modified: 2008-08-04 14:11 UTC
From: alangland at andyl56 dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alangland at andyl56 dot com
New email:
PHP Version: OS:

 

 [2008-08-04 13:34 UTC] 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) ""

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-04 14:11 UTC] bjori@php.net
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
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Nov 26 23:03:13 2021 UTC