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]

Reply via email to