Category
stdlib
Problem
Unicode normalization (normalizer_normalize(), Normalizer class) from ext/intl is missing. function_exists('normalizer_normalize') → false on this VM (Zend with intl: true). Composer, Symfony String, and IDN/email validators depend on NFC/NFD/NFKC normalization.
php-src reference
Repro
test/repro/maintainer_normalizer_normalize.php:
<?php
declare(strict_types=1);
echo function_exists('normalizer_normalize') ? "yes\n" : "no\n";
// NFC: composed é (U+00E9) vs decomposed e + combining acute
$composed = "\xC3\xA9";
$decomposed = "e\xCC\x81";
echo bin2hex(normalizer_normalize($decomposed, Normalizer::FORM_C)), "\n";
echo normalizer_normalize($composed, Normalizer::FORM_C) === $composed ? "stable\n" : "changed\n";
echo normalizer_is_normalized($composed, Normalizer::FORM_C) ? "norm\n" : "not\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/maintainer_normalizer_normalize.php
php bin/vm.php test/repro/maintainer_normalizer_normalize.php 2>&1 | head -5
'
| Check |
Zend + ext/intl |
VM today |
function_exists |
yes |
no |
| NFC decomposed → composed |
c3a9 hex |
fatal undefined |
normalizer_is_normalized |
norm |
N/A |
Negative arm
normalizer_normalize("x", 99); // ValueError / IntlException on bad form constant
Scope (this repo)
| Path |
Work |
ext/intl/normalizer_normalize.php, normalizer_is_normalized.php |
VM builtins |
ext/intl/Normalizer.php or BuiltinClasses.php |
Normalizer::FORM_* constants |
ext/intl/Module.php |
Register (may extend existing skeleton #5153 / #3336) |
| v1 transport |
Host ICU via thin wrapper or pure PHP Unicode tables for bootstrap subset (document gap) |
| Tests |
test/compliance/cases/stdlib/normalizer_normalize.phpt |
Prefer PHP implementation in ext/intl/ for self-host (#1492); avoid permanent C-only ICU glue in runtime/.
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter normalizer_normalize'
Related
Category
stdlibProblem
Unicode normalization (
normalizer_normalize(),Normalizerclass) from ext/intl is missing.function_exists('normalizer_normalize')→ false on this VM (Zend with intl: true). Composer, Symfony String, and IDN/email validators depend on NFC/NFD/NFKC normalization.php-src reference
ext/intl/normalizer/normalizer_normalize.c—PHP_FUNCTION(normalizer_normalize)ext/intl/normalizer/normalizer_class.c—NormalizerconstantsFORM_C,FORM_D,FORM_KC,FORM_KDext/intl/normalizer/normalizer_common.h— ICUunorm2pipelineRepro
test/repro/maintainer_normalizer_normalize.php:function_existsyesnoc3a9hexnormalizer_is_normalizednormNegative arm
Scope (this repo)
ext/intl/normalizer_normalize.php,normalizer_is_normalized.phpext/intl/Normalizer.phporBuiltinClasses.phpNormalizer::FORM_*constantsext/intl/Module.phptest/compliance/cases/stdlib/normalizer_normalize.phptPrefer PHP implementation in
ext/intl/for self-host (#1492); avoid permanent C-only ICU glue inruntime/.Done when
function_exists('normalizer_normalize')&&class_exists('Normalizer')true on VMstable+normlines match Zend./script/ci-fast.sh --filter normalizer_normalizegreenscript/capability-matrix.php)Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter normalizer_normalize'Related