Re: [PHP-DEV] Proposal: native decimal scalar type support

2023-04-26 Thread Rowan Tommins
On 26/04/2023 11:29, Alexander Pravdin wrote: As a user, I want to have native decimal scalar type support. In general, I would absolutely love to have this. 1) Use a native numeric variable type compatible with other numeric types without typecasts: 1 + 0.5 (int + decimal). Although not

Re: [PHP-DEV] Proposal: native decimal scalar type support

2023-04-26 Thread Calvin Buckley
You’re going to likely have this with database as well - at least ODBC presents decimals as strings, because they can’t be represented as a C type (without turning it into a struct of some sort). > On Apr 26, 2023, at 9:23 AM, Alexander Pravdin wrote: > > On Wed, 26 Apr 2023 at 20:52, Benjamin

Re: [PHP-DEV] Proposal: native decimal scalar type support

2023-04-26 Thread Alexander Pravdin
On Wed, 26 Apr 2023 at 20:52, Benjamin Morel wrote: > For what it’s worth, this is already solved in userland: > https://github.com/brick/math When I checked the sources, the first I saw was: > final class BigInteger extends BigNumber > { > private string $value; It also converts to strings ba

Re: [PHP-DEV] Proposal: native decimal scalar type support

2023-04-26 Thread Benjamin Morel
Le mer. 26 avr. 2023 à 12:29, Alexander Pravdin a écrit : > As a user, I want to have native decimal scalar type support. > For what it’s worth, this is already solved in userland: https://github.com/brick/math Now having always-available support for arbitrary precision math in the language, w

[PHP-DEV] Proposal: native decimal scalar type support

2023-04-26 Thread Alexander Pravdin
As a user, I want to have native decimal scalar type support. And at the same time: 1) Use a native numeric variable type compatible with other numeric types without typecasts: 1 + 0.5 (int + decimal). 2) Do not use BCMath that uses strings. In PHP8, passing float values to BCMath may lead to issue

Re: [PHP-DEV] [RFC] [Discussion] Clone with

2023-04-26 Thread Nicolas Grekas
> > > What about using a real closure to define the scope we need for > cloning? > > > That closure would take the cloned instance as argument to allow > > > manipulating it at will. > > > > I believe someone mentioned that one previously in the thread. > > > Yes, Nicolas mentioned me. > I wanted t