Skip to content

Regression: mb_ucwords() phantom on PROFILE=8.4 — Zend 8.4/8.5 function_exists false (re-#20799, ext/mbstring) #21458

Description

@PurHur

Category

Regression · php-src-strict · phantom builtin (Pillar 4)

Problem

mb_ucwords() was added as a “PHP 8.4” forward-profile API (#20799 / #21394 / compliance mb_ucwords_forward84.phpt). Zend php-src never ships mb_ucwords — probed 2026-07-20 against php:8.4-cli (8.4.23) and php:8.5-cli (8.5.8) with mbstring enabled: function_exists('mb_ucwords') === false. Title-case on Zend is mb_convert_case($s, MB_CASE_TITLE).

This reverses the wrong-direction “fix” that treated a missing phantom as a real parity gap.

Repro Zend 8.4.23 / 8.5.8 + mbstring VM PHP_COMPILER_PROFILE=8.4
function_exists('mb_ucwords') false true
mb_ucwords('hello world') undefined function Hello World

Default / 8.2 profile already hides it (mb_ucwords_phantom.phpt green).

php-src reference

PHP implementation target

  • Gate off / remove ext/mbstring/mb_ucwords.php registration on all profiles (including 8.4 forward)
  • Flip test/compliance/cases/mbstring/mb_ucwords_forward84.phpt (+ related) to expect absence; keep phantom guard
  • PHP-in-PHP only; no new C

Repro

./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
printf "%s\n" "<?php echo function_exists(\"mb_ucwords\") ? \"exists:yes\" : \"exists:no\";" > /tmp/mb_ucwords_phantom.php
php bin/vm.php /tmp/mb_ucwords_phantom.php
# expect exists:no; currently exists:yes
'

Done when

  • PHP_COMPILER_PROFILE=8.4: function_exists('mb_ucwords') === false (match Zend)
  • Compliance / unit gates updated (no forward84 “must exist” expectation)
  • php-src-strict; no php-compiler-strict shortcut

Related

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 workingimplementation-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