Bug #64016 [Opn->Wfx]: file_get_contents does not fill up $http_response_header via HEAD method

From: Date: Wed, 02 Oct 2013 05:31:59 +0000
Subject: Bug #64016 [Opn->Wfx]: file_get_contents does not fill up $http_response_header via HEAD method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181926@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64016&edit=1

 ID:                 64016
 Updated by:         mike@php.net
 Reported by:        anil at saog dot net
 Summary:            file_get_contents does not fill up
                     $http_response_header via HEAD method
-Status:             Open
+Status:             Wont fix
 Type:               Bug
 Package:            *URL Functions
 Operating System:   Centos 6.2
 PHP Version:        5.4.11
 Block user comment: N
 Private report:     N

 New Comment:

This feature has been removed from PHP-5.5


Previous Comments:
------------------------------------------------------------------------
[2013-02-20 16:56:01] mattsch at gmail dot com

$http_response_header is undefined after doing a file_get_contents on a url on php 5.3.21 as well.

------------------------------------------------------------------------
[2013-01-18 11:19:42] anil at saog dot net

Description:
------------
PHP is compiled with option "--with-curlwrappers". Whenever a HEAD request issued with
"file_get_contents", "$http_response_header" is not filled-up but upon calling
"get_headers()", variable "$http_response_header" auto-magically filled up.

Test script:
---------------
$url = 'http://www.google.com';
$ctx = stream_context_create();

stream_context_set_option($ctx, array('http' => array('method' =>
'HEAD','timeout' => 60)));

$res = file_get_contents($url, false, $ctx);
var_dump($http_response_header); // NULL
get_headers($url);
var_dump($http_response_header); // filled up correctly

Expected result:
----------------
"$http_response_header" filled-up correctly

Actual result:
--------------
"$http_response_header" is always NULL


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64016&edit=1


Thread (3 messages)

« previous php.bugs (#181926) next »