Skip to content

Regression: mb_str_pad() function_exists() true on 8.2 reference profile (re-#16776, ext/mbstring/mbstring.c) #17469

Description

@PurHur

Category

stdlib · php-src-strict · forward-profile phantom gate regression (re-#16776, re-#16086)

Problem

On the default Zend 8.2 reference profile, mb_str_pad() must be absent from function_exists() until PHP 8.3+ / explicit forward profile. This compiler advertises it on the reference profile because CompilerVersion::advertisesMbStrPad() keys off languageProfileVersion() (8.4.0) while CompilerVersion::VERSION is still 8.4.0-dev.

Repro Zend 8.2 VM reference profile (2026-07-09)
function_exists('mb_str_pad') false true

Callable behavior with PHP_COMPILER_PROFILE=8.4 is fine — this issue is introspection / phantom gate on reference profile only.

php-src reference

PHP implementation target

  • lib/CompilerVersion.phpadvertisesMbStrPad() / supportsMbStrPad() gate on stable runtime or explicit forward profile
  • ext/mbstring/Module.php or BuiltinIntrospectionPolicy — withhold mb_str_pad from function_exists() on reference profile
  • ext/mbstring/mb_str_pad.php — implementation unchanged; registration/policy only

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_mb_str_pad_phantom_reference.php'

Done when

  • Repro prints ok on default reference profile
  • PHP_COMPILER_PROFILE=8.4 still callable and may advertise per forward-profile rules
  • Compliance PHPT for phantom gate under test/compliance/cases/stdlib/
  • php-src-strict; no php-compiler-strict shortcut

North star: #1492 · closed #16776 regressed

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