Skip to content

ext/intl: Expose Spoofchecker restriction-level APIs on all supported ICU versions#22055

Open
LamentXU123 wants to merge 2 commits into
php:PHP-8.4from
LamentXU123:bug-fix-15
Open

ext/intl: Expose Spoofchecker restriction-level APIs on all supported ICU versions#22055
LamentXU123 wants to merge 2 commits into
php:PHP-8.4from
LamentXU123:bug-fix-15

Conversation

@LamentXU123
Copy link
Copy Markdown
Contributor

@LamentXU123 LamentXU123 commented May 15, 2026

Those constants (functions) are made out of the version guard of ICU >= 58 in this PR.

  • Spoofchecker::ASCII
  • Spoofchecker::HIGHLY_RESTRICTIVE
  • Spoofchecker::MODERATELY_RESTRICTIVE
  • Spoofchecker::MINIMALLY_RESTRICTIVE
  • Spoofchecker::UNRESTRICTIVE
  • Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE
  • Spoofchecker::MIXED_NUMBERS
  • Spoofchecker::setRestrictionLevel()

Fixes #22053

@LamentXU123 LamentXU123 marked this pull request as ready for review May 16, 2026 05:47
<?php
$r = new ReflectionClass("Spoofchecker");

var_dump($r->getConstant("ASCII") !== false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test asserts existence only; that's fine since spoofchecker_007.phpt covers behavior, but asserting the constants are distinct integers would also catch a future
fallback collision.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. I don't sure if this time my test is a little bit too verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants