Skip to content

Stdlib: PHP 8.4 forward-profile gated builtins — function_exists/extension_loaded true on reference profile (ext/standard) #16086

Description

@PurHur

Category

stdlib · php-src-strict · forward-profile registration

Problem

With PHP_COMPILER_PROFILE=8.4, builtins and extensions that Zend 8.2 does not expose report as present via function_exists() / extension_loaded(). This breaks parity scripts that gate on reference-profile availability before calling forward-only APIs.

Probe Zend 8.2 (reference) VM profile=8.4 (2026-07-04)
function_exists('fpow') false true
function_exists('mb_str_pad') false true
extension_loaded('bcmath') false true

php-src reference

PHP implementation target

  • ext/standard / builtin registration tables — withhold forward-profile symbols from function_exists until the active runtime profile matches php-src for that symbol
  • lib/ extension probe helpers — align extension_loaded() with Zend reference profile semantics

Repro

./script/docker-exec.sh -- bash -lc '
  export PHP_COMPILER_PROFILE=8.4
  php bin/vm.php test/repro/maintainer_gap_fpow_phantom_registration.php      # exit=1
  php bin/vm.php test/repro/maintainer_gap_mb_str_pad_phantom_function_exists.php  # exit=1
  php bin/vm.php test/repro/maintainer_gap_bcmath_phantom_registration.php    # exit=1
'

Done when

  • All three probes print ok (exit 0) on VM with PHP_COMPILER_PROFILE=8.4 against Zend 8.2 reference
  • Forward builtins still callable when profile + php-src version both allow them
  • Compliance guard for function_exists / extension_loaded gating
  • 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 machineenhancementNew 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