====== PHP RFC: Your Title Here ====== * Version: 0.9 * Date: 2026-02-28 * Author: Yuya Hamada * Status: Draft * Implementation: https://github.com/php/php-src/pull/21311 I noticed there is not exist limit of codepoint that reading Unicode Standard Annex #29([[https://www.unicode.org/reports/tr29/|UAX#29]]). So that means grapheme cluster can crash computer because computer resource is limited but grapheme cluster is not limited. ===== Introduction ===== This proposal is use to safe for grapheme cluster that it is limit codepoint. ===== Proposal ===== Check grapheme cluster's codepoints lower than $limit GRAPHEME_LIMIT_CODEPOINTS is 32, Because based on [[https://unicode.org/reports/tr15/#UAX15-D3|UAX#15 Stream-safe Text Format]]. Unicode's official answer is not rely Stream-safe Text Format, But I think make sense to it. ==== Examples ==== Check the codepoints per grapheme cluster. Then measure grapheme_strlen. Simple example: ===== Backward Incompatible Changes ===== This could break a function existing in userland with the same name. ===== Proposed PHP Version(s) ===== Next of PHP 8.5 (PHP 8.6 or PHP 9.0) ===== RFC Impact ===== ==== To the Ecosystem ==== None ==== To Existing Extensions ==== Adds grapheme_limit_codepoints() to the intl extension. ==== To SAPIs ==== None ===== Future Scope ===== None ===== Voting Choices ===== Please consult [[https://github.com/php/policies/blob/main/feature-proposals.rst#voting-phase|the php/policies repository]] for the current voting guidelines. ---- Primary Vote requiring a 2/3 majority to accept the RFC: * Yes * No * Abstain ===== Patches and Tests ===== https://github.com/php/php-src/pull/21311 ===== Implementation ===== ===== References ===== * https://www.unicode.org/reports/tr29/ * https://unicode-org.atlassian.net/browse/ICU-23302 ===== Rejected Features ===== Keep this updated with features that were discussed on the mail lists. ===== Changelog ===== If there are major changes to the initial proposal, please include a short summary with a date or a link to the mailing list announcement here, as not everyone has access to the wikis' version history.