#34059 [Opn->Csd]: get_headers() returns false and throws warning on 404
| From: | iliaa@php.net | Date: | Mon, 23 Jan 2006 15:05:41 +0000 |
| Subject: | #34059 [Opn->Csd]: get_headers() returns false and throws warning on 404 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92389@lists.php.net to get a copy of this message | ||
ID: 34059
Updated by: iliaa@php.net
Reported By: bjori@php.net
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
PHP Version: 5CVS-2005-08-10 (dev)
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:
------------------------------------------------------------------------
[2005-08-10 02:53:41] bjori@php.net
Description:
------------
I feel like the current behaviur of get_headers() is wrong, i.e. it
doesnt give me the headers on 404 errors etc.
Would like to get the header, even thou its just an error header.
Reproduce code:
---------------
php -r 'print_r(get_headers("http://example.com/non"));'
Expected result:
----------------
Array
(
[0] => HTTP/1.1 404 Not Found
[1] => Date: Wed, 10 Aug 2005 00:47:07 GMT
[2] => Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
[3] => Transfer-Encoding: chunked
[4] => Connection: close
[5] => Content-Type: text/html; charset=iso-8859-1
)
Actual result:
--------------
Warning: get_headers(http://example.com/non): failed to open stream:
HTTP request failed! HTTP/1.1 404 Not Found
in Command line code on line 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34059&edit=1