rfc:http-last-response-headers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:http-last-response-headers [2024/01/04 13:44] – Update wording girgias | rfc:http-last-response-headers [2024/02/29 16:42] (current) – Implemented girgias | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Add http_(get|clear)_last_response_headers() function ====== | ====== PHP RFC: Add http_(get|clear)_last_response_headers() function ====== | ||
- | * Version: 0.1 | + | * Version: 0.2 |
* Date: 2024-01-03 | * Date: 2024-01-03 | ||
* Author: Gina Peter Banyard < | * Author: Gina Peter Banyard < | ||
- | * Status: | + | * Status: |
* Target Version: PHP 8.4 | * Target Version: PHP 8.4 | ||
* Implementation: | * Implementation: | ||
Line 14: | Line 14: | ||
variable is magically created in the local scope whenever an HTTP request is performed through PHP's stream layer, | variable is magically created in the local scope whenever an HTTP request is performed through PHP's stream layer, | ||
i.e. when using the [[https:// | i.e. when using the [[https:// | ||
- | One such usage is using <php>file_get_content()</ | + | One such usage is using <php>file_get_contents()</ |
The [[https:// | The [[https:// | ||
Line 34: | Line 33: | ||
As a replacement, | As a replacement, | ||
[[https:// | [[https:// | ||
+ | |||
+ | ===== Motivation ===== | ||
+ | |||
+ | The primary motivation for adding this function, is to be able to remove the [[https:// | ||
+ | variable completely. To create this variable one needs to use the < | ||
+ | This is also the last usage of this engine function and its sibling function < | ||
+ | |||
+ | Moreover, this variable needs to be special cased in the optimizer/ | ||
+ | (via the < | ||
+ | Which means that any extension that would use this engine API would misbehave under opcache. | ||
+ | |||
+ | See the [[rfc: | ||
+ | section for an impact analysis of the removal of this feature. | ||
===== Proposal ===== | ===== Proposal ===== | ||
Line 72: | Line 84: | ||
and the possible engine and optimizer simplifications, | and the possible engine and optimizer simplifications, | ||
it seems reasonable to slate this feature for removal even without a deprecation notice if the need arises. | it seems reasonable to slate this feature for removal even without a deprecation notice if the need arises. | ||
+ | |||
+ | ===== Rejected ideas ===== | ||
+ | |||
+ | One suggested idea was to provide those headers via a by-reference entry to the stream context. | ||
+ | This idea was rejected by us, and other members of the PHP Foundation, | ||
+ | as we wish to maintain stream contexts as a stateless configuration data structure passed to the stream. | ||
+ | |||
+ | This one-to-one feature replacement does not prevent the introduction of a more generic solution for other stream wrappers. | ||
+ | And this pair of new functions can always be slated for future deprecation and removal. | ||
===== Version ===== | ===== Version ===== | ||
Line 81: | Line 102: | ||
As per the voting RFC a yes/no vote with a 2/3 majority is needed for this proposal to be accepted. | As per the voting RFC a yes/no vote with a 2/3 majority is needed for this proposal to be accepted. | ||
- | Voting started on 2024-XX-XX and will end on 2024-XX-XX. | + | Voting started on 2024-01-29 and will end on 2024-02-14. |
<doodle title=" | <doodle title=" |
rfc/http-last-response-headers.1704375847.txt.gz · Last modified: 2024/01/04 13:44 by girgias