Re: [RFC] [Discussion] Add bcdivmod to BCMath

From: Date: Sun, 30 Jun 2024 23:43:08 +0000
Subject: Re: [RFC] [Discussion] Add bcdivmod to BCMath
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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 won't notice.  99% of
> the time I believe that is the correct approach.
> 
> I can see the argument that this is the other 1%, since it's just two values, which will
> basically always be wanted separately but both wanted (meaning divmod(...)->divsor is kinda
> pointless), and their order should be fairly self-evident.
> 
> However, in that case I would urge that both the RFC and the resulting documentation *always*
> use examples that return into a [$foo, $bar] destructured list.  Don't even
> suggest that people should use 0 and 1 indexes.  It's a tuple for deconstruction, that's
> it, if you're using it some other way you're probably wrong.  Politely ignore that
> it's even possible, lest we lead people down the dark path.
> 
> (Which means removing the current index-using example and just keeping the pizza example.)
> 
> --Larry Garfield  

Thanks, agree. I rewrote the non-pizza example.

Regards,

Saki


Thread (14 messages)

« previous php.internals (#124119) next »