|  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
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:
20 + 31 = ?
Subscribe to this entry?

 [2008-08-04 13:34 UTC] alangland at andyl56 dot com
http_get is supposed to return false on connection timeout, but instead it returns an empty string.

Reproduce code:
if (false === ($http = http_get('', array('timeout' => 15, 'connecttimeout' => 15)))) {
  echo 'FALSE returned';
else {

Expected result:
FALSE returned

Actual result:
string(0) ""


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-04 14:11 UTC]
http_get() is a part of the pecl/http extension (

Any bugs against this extension should be filed in the pecl bug tracker:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 10 15:01:27 2023 UTC