Re: [RFC][Discussion] Grapheme Mask

From: Date: Sun, 28 Jun 2026 12:29:37 +0000
Subject: Re: [RFC][Discussion] Grapheme Mask
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-131556@lists.php.net to get a copy of this message
On 28/06/2026 10:59, Ayesh Karunaratne wrote:
**Suggestion**: I find the limitations of $start and $length too restrictive. Laravel's Str::mask[^1] for example offers more expressive control over the offset and length.
The only difference I can see is the use of a negative start parameter to count backwards from the end of the string. I agree that would be a useful addition, and consistent with other functions such as substr() and array_splice(). Are there other options that Laravel provides, or which you think could be provided? On the subject of consistency, it looks like other functions use $offset rather than $start, so we should be consistent with that - especially now we have named parameter calling. I'm not sure if there's a direct equivalent to $mask_char anywhere which we should match. -- Rowan Tommins [IMSoP]

« previous php.internals (#131556) next »