Skip to content

Regression: PHP 8.4 forward-profile http/stream builtins visible to function_exists on reference harness (re-#16086, ext/standard) #16346

Description

@PurHur

Category

Regression · php-src-strict · forward-profile phantom introspection

Problem

With PHP_COMPILER_PROFILE=8.4 on the 8.4.0-dev reference harness (Zend 8.2 semantics), several PHP 8.4-only symbols report present via function_exists() even though Zend 8.2 returns false. Issue #16086 closed the fpow/mb_str_pad/bcmath phantom path; http_get_last_response_headers() and stream_context_set_options() still leak through BuiltinIntrospectionPolicy / registration advertises helpers.

Probe (PHP_COMPILER_PROFILE=8.4) Zend 8.2 VM (2026-07-05)
function_exists('http_get_last_response_headers') false true
function_exists('http_clear_last_response_headers') false true
function_exists('stream_context_set_options') false true
function_exists('fpow') false false (OK post-#16086)

php-src reference

PHP implementation target

  • ext/standard/BuiltinIntrospectionPolicy.php — route http/stream 8.4 symbols through advertises* helpers that return false on 8.4.0-dev reference (same pattern as advertisesFpow())
  • lib/CompilerVersion.php — add/adjust advertisesHttpResponseHeaders() / advertisesStreamContextSetOptions() if needed
  • Keep symbols callable when both profile and php-src version allow; only fix introspection

Repro

./script/docker-exec.sh -- bash -lc '
  PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_http_response_headers_phantom_reference.php
  PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_stream_context_set_options_phantom_reference.php
'

Done when

  • Both probes print ok (exit 0) with PHP_COMPILER_PROFILE=8.4 against Zend 8.2 reference semantics
  • Forward builtins still callable when runtime + php-src both allow
  • Unit guard in test/unit/ForwardProfilePhantomIntrospectionTest.php (or sibling)
  • php-src-strict; no php-compiler-strict shortcut

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions