> Le 14 juil. 2022 à 06:32, Guilliam Xavier <guilliam.xav...@gmail.com> a écrit 
> :
> 
> On Thursday, July 14, 2022, Go Kudo <g-k...@colopl.co.jp> wrote:
> 
>> 2022年7月13日(水) 1:10 Tim Düsterhus <t...@bastelstu.be>:
>> 
>>> Hi
>>> 
>>> On 7/12/22 18:04, Tim Düsterhus wrote:
>>>> I also think that both '$string' and '$binary' are appropriate parameter
>>>> names in this case, so particular preference from my side.
>>> 
>>> Sorry for the follow-up, there's two mistakes in that sentence. It
>>> should read:
>>> 
>>> I also think that both '$string' and **'$bytes'** are appropriate
>>> parameter names in this case, so **no** particular preference from my
>>> side.
>>> 
>>> Best regards
>>> Tim Düsterhus
>>> 
>> 
>> Hi
>> 
>> I agree with you. I will change the parameter name from `$string` to
>> `$bytes` as I don't see any problem.
>> 
>> I will try to explain the changes more rigorously in future proposals.
>> Thank you.
>> 
>> Regards,
>> Go Kudo
>> 
> 
> Hi,
> 
> I was waiting for more opinions but... so here's mine:
> 
> I would prefer to keep "$string", as [that's how I read the RFCs, and] when
> calling e.g. shuffleBytes('foobar') I don't feel like I'm passing "bytes"
> (or "a binary") but a string (to be shuffled byte-wise rather than
> character-wise or codepoint-wise, but that's from the function, not the
> argument)...
> Granted, not compelling, and probably won't matter in practice, but hey ;)
> 
> Regards
> 
> PS: sent from mobile
> 
> 
> -- 
> Guilliam Xavier

I agree with Guilliam: this function is about «shuffling the bytes of the given 
string» (as opposed to, say, «array of ints»)

As precedent, there are `bin2hex($string)` and `md5($string)`, which are 
unambiguously working with bytes from data given in the form of string, where 
«string» is a PHP type, which can hold data that is not necessarily 
UTF-8-encoded or Shift-JIS-encoded text.

—Claude

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to