Category
Regression · php-src-strict · ext/intl grapheme · phantom builtin
Problem
function_exists('grapheme_levenshtein') is true on default / 8.2 / 8.3 / 8.4 / 8.5 profiles. Zend/php-src does not ship this function (ICU levenshtein RFC never landed; absent from ext/intl/grapheme/grapheme.stub.php on php-src master). Same class of phantom as mb_ucwords (#21458).
Verified 2026-07-23:
| Profile |
function_exists('grapheme_levenshtein') |
| default / 8.2 / 8.3 / 8.4 / 8.5 |
yes (wrong) |
| Zend 8.2 host |
no |
php-src grapheme.stub.php |
no grapheme_levenshtein |
Prior impl tracker: #6998 (closed) — should have stayed ungated/unregistered like Zend.
php-src reference
PHP implementation target
ext/intl/Module.php — stop registering grapheme_levenshtein (or gate always-false like mb_ucwords / CompilerVersion advertisement)
- Keep
ext/intl/grapheme_levenshtein.php / VmGrapheme::levenshtein only if useful internally; must not appear in function_exists / call tables
- PHP-in-PHP; no new C
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_grapheme_levenshtein_phantom.php'
PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_grapheme_levenshtein_phantom.php
<?php
echo function_exists('grapheme_levenshtein') ? "fail\n" : "ok\n";
Done when
Category
Regression· php-src-strict · ext/intl grapheme · phantom builtinProblem
function_exists('grapheme_levenshtein')is true on default / 8.2 / 8.3 / 8.4 / 8.5 profiles. Zend/php-src does not ship this function (ICU levenshtein RFC never landed; absent fromext/intl/grapheme/grapheme.stub.phpon php-src master). Same class of phantom asmb_ucwords(#21458).Verified 2026-07-23:
function_exists('grapheme_levenshtein')grapheme.stub.phpgrapheme_levenshteinPrior impl tracker: #6998 (closed) — should have stayed ungated/unregistered like Zend.
php-src reference
ext/intl/grapheme/grapheme.stub.php— no levenshteinPHP implementation target
ext/intl/Module.php— stop registeringgrapheme_levenshtein(or gate always-false likemb_ucwords/CompilerVersionadvertisement)ext/intl/grapheme_levenshtein.php/VmGrapheme::levenshteinonly if useful internally; must not appear infunction_exists/ call tablesRepro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_grapheme_levenshtein_phantom.php' PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_grapheme_levenshtein_phantom.phpDone when
function_exists('grapheme_levenshtein') === falseon every profile (match Zend)test/compliance/cases/