Skip to content

Commit 8a8b376

Browse files
committed
add tests
1 parent 1fa8c0f commit 8a8b376

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Reading $http_response_header without explicit assignment triggers deprecation warning
3+
--FILE--
4+
<?php
5+
6+
function foo() {
7+
echo $http_response_header;
8+
}
9+
10+
foo();
11+
12+
?>
13+
--EXPECTF--
14+
Deprecated: The predefined locally scoped $http_response_header variable is deprecated, call http_get_last_response_headers() instead in %s on line %d
15+
16+
Warning: Undefined variable $http_response_header in %s on line %d

Zend/zend_compile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,6 @@ static zend_op *zend_compile_simple_var_no_cv(znode *result, const zend_ast *ast
29712971

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

0 commit comments

Comments
 (0)