[php-src] PR #22614: Add grapheme_mask() function Grapheme mask
| From: | sepehrphpr | Date: | Mon, 06 Jul 2026 11:29:46 +0000 |
| Subject: | [php-src] PR #22614: Add grapheme_mask() function Grapheme mask | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36861@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22614
Author: sepehrphpr
This PR implements the grapheme_mask() function as proposed in the RFC:
https://wiki.php.net/rfc/grapheme_mask
The function works similarly to str_mask() but operates on grapheme cluster
boundaries instead of bytes/code points, making it fully Unicode-safe.
It uses ICU BreakIterator for grapheme boundary detection, consistent with
other grapheme_*() functions in ext/intl.
Changes:
Added grapheme_mask.c and grapheme_mask.h (Modified BSD license)
Implemented grapheme_mask() using ICU BreakIterator
Added grapheme_mask() declaration to grapheme.stub.php
Generated grapheme_arginfo.h
Added grapheme_mask.phpt test case