On Sun, Jun 30, 2024, at 16:16, Juliette Reinders Folmer wrote: > On 30-6-2024 16:04, Saki Takamachi wrote: >> Hi internals, >> >> I created an RFC and put it in discussion status. >> https://wiki.php.net/rfc/add_bcdivmod_to_bcmath >> >> I expect return values will probably be the main topic of discussion. >> >> Regards, >> >> Saki >> > > Just a suggestion: what about making the returned array an associative array > ? Like so: > ``` > array( > 'quotient' => 61, > 'remainder' => 1, > ); > ``` > > This would remove the need for devs to remember the order of the return > values and would make the return value self-documenting.
I came here to say the same thing. The best solution would be not having to refer to documentation or experiment with values, and this hits the nail on the head. The only thing that makes it weird is having to write it out, which at that point, it is probably faster to type out bcdiv and bcmod separately. Have you considered simply using references passed to the function? I feel like that is more idiomatically php. — Rob