Skip to content

Gate grapheme_str_contains/strimwidth on ext/intl for function_exists (#11825) - #16966

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-11825-grapheme-intl-gate
Jul 6, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-11825-grapheme-intl-gate

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • grapheme_str_contains() and grapheme_strimwidth() were the only intl grapheme helpers still visible to function_exists() without ext/intl loaded on the PHP 8.4 forward profile.
  • Route both through IntlExtensionPolicy::advertisesBuiltins() in BuiltinIntrospectionPolicy, matching grapheme_strlen / grapheme_str_split and php-src ext/intl/php_intl.c module registration.
  • Forward-profile helpers remain callable when registered; only introspection is gated (php-src-strict).

php-src reference

  • ext/intl/php_intl.c — grapheme helpers registered only with loaded intl module
  • ext/standard/basic_functions.c — function_exists() / internal function table

PHP implementation

  • ext/standard/BuiltinIntrospectionPolicy.php — intl gate for grapheme_str_contains / grapheme_strimwidth
  • JIT/AOT function_exists() already delegates to the same policy via JitFunctionExists / FunctionExistsJitHelper

Verification

source script/php-env.sh
php bin/vm.php test/repro/maintainer_gap_grapheme_str_split_without_intl.php
# ok: absent

export PHP_COMPILER_PROFILE=8.4
php bin/vm.php test/repro/maintainer_gap_grapheme_function_exists_forward_84.php
# ok

vendor/bin/phpunit --filter 'grapheme_phantom|grapheme_profile_84' test/compliance/VMTest.php
# OK (2 tests)

vendor/bin/phpunit --filter 'ForwardProfilePhantomIntrospectionTest::testGraphemeProfile84|IntlModuleTest'
# OK (3 tests, 1 skipped)

php bin/compile.php -l test/repro/maintainer_gap_grapheme_str_split_without_intl.php
php bin/compile.php -l test/fixtures/aot/compile-only/grapheme_strimwidth_literals.php
# both exit 0

Closes #11825

Made with Cursor

…#11825)

Zend only advertises intl grapheme helpers when ext/intl is loaded; forward-profile
registration stays callable but introspection now matches php-src for all grapheme_*.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit a827db8 into master Jul 6, 2026
@PurHur
PurHur deleted the agent/issue-11825-grapheme-intl-gate branch July 6, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: grapheme_str_split() without ext/intl — function_exists true, Zend false (ext/intl/grapheme)

1 participant