Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Zend/tests/http_response_header_deprecated_read.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
Reading $http_response_header without explicit assignment triggers deprecation warning
--FILE--
<?php

function foo() {
echo $http_response_header;
}

foo();

?>
--EXPECTF--
Deprecated: The predefined locally scoped $http_response_header variable is deprecated, call http_get_last_response_headers() instead in %s on line %d

Warning: Undefined variable $http_response_header in %s on line %d
1 change: 0 additions & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2971,7 +2971,6 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, const zend_ast *ast

opline->extended_value = ZEND_FETCH_GLOBAL;
} else {
// TODO: Have a test case for this?
if (name_node.op_type == IS_CONST
&& type == BP_VAR_R
&& zend_string_equals_literal(Z_STR(name_node.u.constant), "http_response_header")) {
Expand Down
Loading