1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/standard: Fix GH-19610 (Deprecation warnings in functions taking as argument) (#19611)

This commit is contained in:
Gina Peter Banyard
2025-08-28 11:48:41 +01:00
committed by GitHub
parent dee0042502
commit 9794f483d4
3 changed files with 20 additions and 0 deletions

4
NEWS
View File

@@ -8,6 +8,10 @@ PHP NEWS
- Session:
. Fix RC violation of session SID constant deprecation attribute. (ilutov)
- Standard:
. Fix GH-19610 (Deprecation warnings in functions taking as argument).
(Girgias)
- URI:
. Fixed memory management of Uri\WhatWg\Url objects. (timwolla)
. Fixed memory management of the internal "parse_url" URI parser.

View File

@@ -7800,6 +7800,8 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32
ZSTR_VAL(name));
} else if (zend_string_equals(name, ZSTR_KNOWN(ZEND_STR_THIS))) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as parameter");
} else if (zend_string_equals_literal(name, "http_response_header")) {
CG(context).has_assigned_to_http_response_header = true;
}
if (op_array->fn_flags & ZEND_ACC_VARIADIC) {

View File

@@ -0,0 +1,14 @@
--TEST--
$http_reponse_header as a parameter name should not warn
--FILE--
<?php
function foo($http_response_header) {
var_dump($http_response_header);
}
foo("OK");
?>
--EXPECT--
string(2) "OK"