Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-07-12 Thread Saki Takamachi
Hi all, > 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 The disscussion appears to have calmed down. I'm going to open up

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-07-10 Thread Derick Rethans
On Wed, 10 Jul 2024, Derick Rethans wrote: > On Mon, 1 Jul 2024, Saki Takamachi wrote: > > The example has: > > [$perMouth, $slicesLeft] = $slicesOfPizza->divmod($mouthsToFeed); > > // $perMouth->value is '2' > // $slicesLeft->value is '2' > > Shouldn't that be (withou

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-07-10 Thread Derick Rethans
On Mon, 1 Jul 2024, Saki Takamachi wrote: > Hi, > > >> 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 th

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-07-05 Thread Tim Düsterhus
Hi On 6/30/24 18:08, Rob Landers wrote: We can argue the semantics of input/output, but the point still stands that return by reference is still more common than structured array, and even then, those are usually much bigger things. Happy to argue with you. I explained for each of the examp

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Saki Takamachi
Hi Larry, > I agree an associative array is the second-worst option. An inout by-ref > argument is the absolute worst. > > Normally my default position is that when in doubt, make it a structured > object with properly defined properties, and screw whatever micro-performance > hit it is, you

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 17:45, Tim Düsterhus wrote: > Hi > > On 6/30/24 17:31, Rob Landers wrote: > > - list() -- kinda > > That is not a function. > > > - array_shift(), array_pop(), etc. > > These do not return by out-parameter. These return the value and modify > the array by reference to

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Tim Düsterhus
Hi On 6/30/24 17:31, Rob Landers wrote: - list() -- kinda That is not a function. - array_shift(), array_pop(), etc. These do not return by out-parameter. These return the value and modify the array by reference to remove the returned value. - preg_match*() These only return suppleme

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Larry Garfield
On Sun, Jun 30, 2024, at 10:11 AM, Saki Takamachi wrote: > Hi, > >>> 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 remembe

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Rob Landers
On Sun, Jun 30, 2024, at 17:11, Saki Takamachi wrote: > Hi, > > >> 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 t

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Saki Takamachi
Hi, >> 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 s

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Rob Landers
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 d

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Tim Düsterhus
Hi On 6/30/24 16:16, Juliette Reinders Folmer wrote: 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

Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Juliette Reinders Folmer
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 a

[PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath

2024-06-30 Thread Saki Takamachi
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