Category
stdlib · php-src-strict
Problem
Zend only registers locale_get_default(), locale_set_default(), and class Locale when ext/intl is loaded. On a typical CLI build without intl, function_exists('locale_get_default') is false. This compiler always exposes the symbols (VM-first #9576), so portable function_exists guards mis-detect intl availability.
| Repro |
Zend 8.2 (no intl) |
VM (2026-07-04) |
function_exists('locale_get_default') |
false |
true |
class_exists('Locale') |
false |
true |
Same class of bug as #11825 (grapheme_* without intl).
php-src reference
PHP implementation target
ext/intl/Module.php — gate registration on intl/ICU availability flag matching Zend
ext/intl/locale_get_default.php, Locale.php — keep PHP implementations; hide symbols when gated
lib/VM/Reflection / function_exists path — respect module gate (no permanent stubs visible without intl)
Repro
./script/docker-exec.sh -- bash -lc 'php -r "var_export(function_exists('"'"'locale_get_default'"'"'));"'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r "var_export(function_exists('"'"'locale_get_default'"'"'));"'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_locale_get_default.php'
Done when
Category
stdlib· php-src-strictProblem
Zend only registers
locale_get_default(),locale_set_default(), and classLocalewhen ext/intl is loaded. On a typical CLI build without intl,function_exists('locale_get_default')is false. This compiler always exposes the symbols (VM-first #9576), so portablefunction_existsguards mis-detect intl availability.function_exists('locale_get_default')falsetrueclass_exists('Locale')falsetrueSame class of bug as #11825 (grapheme_* without intl).
php-src reference
ext/intl/php_intl.c— module init registers locale API only with intlext/intl/locale/locale.c—LocaleclassPHP implementation target
ext/intl/Module.php— gate registration on intl/ICU availability flag matching Zendext/intl/locale_get_default.php,Locale.php— keep PHP implementations; hide symbols when gatedlib/VM/Reflection/function_existspath — respect module gate (no permanent stubs visible without intl)Repro
Done when
function_exists('locale_get_default')andclass_exists('Locale')are false (match Zend)test/compliance/cases/intl/locale_gated.phpt