From:             anil at saog dot net
Operating system: Centos 6.2
PHP version:      5.4.11
Package:          *URL Functions
Bug Type:         Bug
Bug description:file_get_contents does not fill up $http_response_header via 
HEAD method

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 bug report at https://bugs.php.net/bug.php?id=64016&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64016&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64016&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64016&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64016&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64016&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64016&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64016&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64016&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64016&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64016&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64016&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64016&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64016&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64016&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64016&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64016&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64016&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64016&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64016&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64016&r=mysqlcfg

Reply via email to