On Monday, July 25, 2022, Guilliam Xavier <guilliam.xav...@gmail.com> wrote:
> On Sat, Jul 9, 2022 at 1:56 AM mickmackusa <mickmack...@gmail.com> wrote: > >> I've discovered that several native string functions offer a character >> mask >> as a parameter. >> >> I've laid out my observations at >> https://stackoverflow.com/q/72865138/2943403 >> > > Out of curiosity, why do you say that strtr() is "not a good candidate > because character order matters" (although you give a reasonable example)? > Maybe you have some counter-example? > > Regards, > > -- > Guilliam Xavier > I prefer to keep my scope very tight when posting on Stack Overflow. My focus was purely on enabling character range syntax for native functions with character mask parameters. My understanding of character masks in PHP requires single-byte characters and no meaning to character order. When strtr() is fed two strings, they cannot be considered "character masks" because the character orders matter. If extending character range syntax to parameters which are not character masks, I might support the feature for strtr(), but ensuring that the two strings are balanced will be made more difficult with ranged syntax. strtr() will silently condone imbalanced strings. https://3v4l.org/PY15F