Bug #67695 [NEW]: Notice error by echo $http_response_header

From: Date: Mon, 28 Jul 2014 09:26:26 +0000
Subject: Bug #67695 [NEW]: Notice error by echo $http_response_header
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186838@lists.php.net to get a copy of this message
From:             info at hollander-ict dot nl
Operating system: Windows 7 SP1 32Bit
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:Notice error by echo $http_response_header

Description:
------------
I want to get the response headers, but I get a notice error.
I open the file with file_get_contents, but the $http_response_header is
empty

Test script:
---------------
<?php
Class core {
var $error = FALSE;
	function call($string) {
		if (!file_exists($string)) {
		@file_get_contents($string);
			if ($http_response_header != "HTTP/1.1 200 OK") {
				return $error = $http_response_header;
			}
		} else {
			return header("Location:".$string);
		}
	}

?>

Expected result:
----------------
I expect a http_responde, like HTTP/1.1 200 OK

Actual result:
--------------
A Notice error when I echo the HTTP/1.1 200 OK

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



Thread (3 messages)

« previous php.bugs (#186838) next »