Re: RFC [Discussion]: Randomizer Additions

From: Date: Sun, 30 Oct 2022 01:07:56 +0000
Subject: Re: RFC [Discussion]: Randomizer Additions
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-118915@lists.php.net to get a copy of this message
On Sat, Oct 29, 2022 at 6:02 PM Jordan LeDoux <jordan.ledoux@gmail.com> wrote: > > > On Sat, Oct 29, 2022 at 12:21 PM Jordan LeDoux <jordan.ledoux@gmail.com> > wrote: > >> >> >> >> Well... perhaps. But "get bytes from character list" would do exactly >> what it says it will do, even from UTF-8 strings. It will use any of the >> bytes from the character list, even if one character in the list may >> contribute multiple bytes to choose from. It is *not* contradictory, just >> potentially confusing about the result >> >> Jordan >> > > On second thought, isn't it possible to simply choose a random integer to > correspond with the char list position instead, sidestepping the UTF-8 > issue entirely? In which case, it might be more accurate to name it just > getRandomCharFromList > > Jordan > Nevermind, disregard. I just remembered (again) how strings are handled in PHP and why this wouldn't work. Jordan

« previous php.internals (#118915) next »