Skip to content

Web: Full header() support in JIT/AOT (replace flag, response_code) #51

@PurHur

Description

@PurHur

Problem

VM header() supports 1–3 arguments via PHP's header(). JIT path rejects $argc > 1:

// ext/standard/header_.php
throw new \LogicException(
    'header() JIT only supports a single string argument in this compiler build'
);

Web apps use header('Location: /foo', true, 302) and header(..., false) for multiple headers.

Goal

Parity between VM and JIT/AOT for common header() usage.

Tasks

  • Extend JitHeader / LLVM helpers for optional replace + response code
  • Track sent headers in standalone runtime (prevent duplicates when replace=false)
  • PHPT in test/compliance and test/real for 302 redirect pattern
  • http_response_code() builtin (optional, can be separate issue)

Acceptance criteria

JIT-compiled script can send redirect and custom header lines matching VM output.

Files

  • ext/standard/header_.php
  • ext/standard/JitHeader.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions