# [RFC] grapheme_str_pad()

- Thread: https://externals.io/message/132995
- Original archive: https://news-web.php.net/php.internals/132995
- Started by Chris Abner Herrera Navarro on 2026-11-03T23:01:51+00:00
- Messages: 1
- RFC: grapheme_str_pad() (Under discussion) — https://externals.io/rfc/grapheme_str_pad.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #132995 — Chris Abner Herrera Navarro — 2026-11-03T23:01:51+00:00

URL: https://externals.io/message/132995#132995

Hi internals,

I'd like to start the discussion on a new RFC:
https://wiki.php.net/rfc/grapheme_str_pad

It proposes grapheme_str_pad(), the grapheme cluster counterpart of `str_pad()` and `mb_str_pad()`, following the Future Scope of the mb_str_pad
RFC. The length is counted in grapheme clusters, so text in NFD, kana with
a combining dakuten, Indic scripts and emoji sequences are padded to the
same visible length as their single code point equivalents, and the padding
string is only cut on grapheme cluster boundaries.

Semantics and errors mirror `mb_str_pad()`. For ASCII input the result is
identical to `str_pad()`.

Implementation: https://github.com/php/php-src/pull/25179

Thanks,
Chris Abner Herrera Navarro
