Uh oh!
There was an error while loading. Please reload this page.
ext/standard: Deprecate $http_response_header - #19464
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Hm, doesn't this need to be on the op array context instead? Otherwise we only warn once per compilation instead of once per file?
There was a problem hiding this comment.
I've added tests and it seems to work as I expect it
There was a problem hiding this comment.
Yeah okay I see I actually think I wanted to say "once per op_array", but if that's the intention that's fine I guess?
There was a problem hiding this comment.
But it seems to be once per op_array 🤔
There was a problem hiding this comment.
I'll check this again tomorrow when I'm more awake
There was a problem hiding this comment.
I see you reset the variable when a new op context starts, but they can be nested. So the following emits 2 deprecations even though it should only emit 1 (artificial example I know, but a simple one):
<?phpfunctionfoo() {
$http_response_header = "foo";
functionnested() {
echo$http_response_header;
}
echo$http_response_header;
}You can remove the code from "nested" and it will still emit a deprecation that should not be happening.
d72a12a to
3b716b4CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I see you reset the variable when a new op context starts, but they can be nested. So the following emits 2 deprecations even though it should only emit 1 (artificial example I know, but a simple one):
<?phpfunctionfoo() {
$http_response_header = "foo";
functionnested() {
echo$http_response_header;
}
echo$http_response_header;
}You can remove the code from "nested" and it will still emit a deprecation that should not be happening.
Uh oh!
There was an error while loading. Please reload this page.
There seems to be an issue here @Girgias if you have a function taking $http_response_header as argument it warns about every usage.. See https://github.com/composer/composer/actions/runs/17278161064/job/49040109053 for the failures: and composer/composer#12513 seems to fix it. Easy fix but I'd argue if you can make it not complain in those cases it would be nicer. |
Girgias
commented
Aug 27, 2025
Ah yes, that makes sense will fix it, can you open a dedicated issue for this? :) |
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable