Skip to content

implement php 8.4 http_get_last_response_headers and http_clear_last_response_headers - #4

Open
vapebw wants to merge 2 commits into
TrixNEW:mainfrom
vapebw:feat/php84-http-response-headers
Open

implement php 8.4 http_get_last_response_headers and http_clear_last_response_headers#4
vapebw wants to merge 2 commits into
TrixNEW:mainfrom
vapebw:feat/php84-http-response-headers

Conversation

@vapebw

@vapebw vapebw commented Aug 31, 2026

Copy link
Copy Markdown

Implemented PHP 8.4 http_get_last_response_headers() and http_clear_last_response_headers().

Changes

  • src/runtime/vm.zig: Added last_http_response_headers: ?*PhpArray = null to VM struct and reset it in VM.reset().
  • src/stdlib/http.zig: Implemented http_get_last_response_headers() and http_clear_last_response_headers() in entries.
  • src/stdlib/native_params.zig: Registered 0-arg parameter signatures for named arguments.
  • src/stdlib/filesystem.zig: Added CURLOPT_HEADERFUNCTION in fetchUrl() to capture response headers into last_http_response_headers on HTTP requests, and reset state on request entry.
  • tests/php84_http_response_headers.php: Added regression tests for function existence, return types, repeated clears, and reflection metadata.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: e774eba8-effa-4421-abb6-8baaeec5a9e1


Comment @coderabbitai help to get the list of available commands.

@TrixNEW

TrixNEW commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR @vapebw. It looks good but you need to add actual HTTP regression tests. We should verify headers after file_get_contents() as well as redirects, HTTP error responses, failed requests, and clearing after a real request. The current tests, for the most part, verify registration/state and don't actually test the main behavior being implemented.

@vapebw

vapebw commented Sep 1, 2026

Copy link
Copy Markdown
Author

Thanks for the PR @vapebw. It looks good but you need to add actual HTTP regression tests. We should verify headers after file_get_contents() as well as redirects, HTTP error responses, failed requests, and clearing after a real request. The current tests, for the most part, verify registration/state and don't actually test the main behavior being implemented.

I think its done now, regression tests are working i will appreciate review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants