diff --git a/Zend/tests/http_response_header_deprecated_read.phpt b/Zend/tests/http_response_header_deprecated_read.phpt new file mode 100644 index 000000000000..6e3966b1919e --- /dev/null +++ b/Zend/tests/http_response_header_deprecated_read.phpt @@ -0,0 +1,16 @@ +--TEST-- +Reading $http_response_header without explicit assignment triggers deprecation warning +--FILE-- + +--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 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 6734db09a2e9..6b385f354fde 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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")) {