On Wed, Jun 23, 2021 at 9:15 AM Hamza Ahmad <office.hamzaah...@gmail.com>
wrote:

>
> Since feature freeze for 8.1 is approaching, I want to request two useful
> string functions that exist in various languages-especially those that run
> on web servers and used in databases. These are respectively `left();` and
> `right();`
>
>
Sorry, you spent several paragraphs insisting that these are
common functions, but you didn't explain what they're meant to actually do.

Using some context, I would assume you mean this:

function str_left(string $str, int $len): string {
  return substr($str, 0, $len);
}

function str_right(string $str, int $len): string {
  return substr($str, -$len);
}

If that's the case, then.... why?  As you can see, the existing
functionality available is trivial to write.  You don't even need to know
any particular amount of math (which I've been recently informed shouldn't
be a prerequisite to writing software -- shakes fist at clouds).

Am I misunderstanding what these proposed functions should do, or am I
underestimating the difficulty of typing a zero or negative sign on certain
keyboards?

-Sara

Reply via email to