I am against adding these functions, but for different reasons than Sara
and George.
If we add str_left and str_right then there should be a corresponding
variant in mbstring. The byte-string functions are rarely useful. Adding
these functions to mbstring unnecessarily complicates the extension for
little to no gain.
Another point is that if we decide to add them, then we will bikeshed
forever in an unresolvable manner about the name. Should it be called
str_left or strleft? Current functions don't have a naming convention, so
using either variant will be wrong.
Personally, I find substr to be more clear about the intent. I know that I
am asking for a part of the string. Whereas str_left doesn't convey an
action immediately. Without knowing its purpose I wouldn't know if it will
pad the string from the left, strip characters from left, or take the
leftmost part of the string.
Don't take it the wrong way, but I think it's a waste of time to implement
a function that doesn't even need a polyfill in the userland.

Regards,
Kamil

Reply via email to