Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type

2024-03-17 Thread Alexander Pravdin
Sorry for the so late reply, but I would like to continue the discussion on this topic. On Tue, Dec 12, 2023 at 10:04 PM G. P. B. wrote: >> I didn't know that the strict types directive was a mistake. My intention is >> to be able to write clean all-decimal units of code and not break the >>

Re: [PHP-DEV] Supporting object types in BCMath

2024-03-17 Thread Jordan LeDoux
On Sun, Mar 17, 2024 at 5:05 PM Saki Takamachi wrote: > Hi Jordan, > > > Using a BCNum inside a loop is the use case, where every loop would > result in memory allocation for a new object, as well as the overhead of > the constructor, etc. > > > > Granted, only people who REALLY know what they

Re: [PHP-DEV] Supporting object types in BCMath

2024-03-17 Thread Saki Takamachi
Hi Jordan, > Using a BCNum inside a loop is the use case, where every loop would result in > memory allocation for a new object, as well as the overhead of the > constructor, etc. > > Granted, only people who REALLY know what they are doing should be doing > this. Though my library which

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-17 Thread Ilija Tovilo
Hi Rowan On Sun, Mar 17, 2024 at 3:41 PM Rowan Tommins [IMSoP] wrote: > > The remaining difference I can see in the current RFC which seems to be > unnecessary is that combining with set is only allowed on virtual > properties. Although it may be "virtual" in the strict sense, any > hook must

Re: [PHP-DEV] Supporting object types in BCMath

2024-03-17 Thread Saki Takamachi
Hi, I created a prototype, although it's pretty rough. It can overload operators and calculate not only between `BcNum` but also between `BcNum` and `int` or `string`. https://github.com/php/php-src/pull/13741 I compared the execution times. Test code: ```

Re: [PHP-DEV] Supporting object types in BCMath

2024-03-17 Thread Jordan LeDoux
On Sat, Mar 16, 2024 at 8:39 AM Saki Takamachi wrote: > Hi Barney, > > Thanks, that's what I was starting to worry about too. It seems like a > good idea to support only immutability, as you say earlier in your proposal. > > Regards. > > Saki Using a BCNum inside a loop is the use case, where

Re: [PHP-DEV] [RFC][Discussion] Raising zero to the power of negative number

2024-03-17 Thread Jorg Sowa
Thank you Marc for your opinion. It makes sense to me that we should have the possibility to mimic the IEEE-754 standard, thus we should have `fpow` function as well. I have updated the RFC and would like to start the voting if there are no new comments. Kind regards, Jorg Sowa

Re: [PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Vincent Langlet
Hi, IMHO, the more meaningful cases of the RFC are missing : round(float, precision: >= 0): int|float // only cast to float for int overflow ceil(float): int|float // only cast to float for int overflow floor(float): int|float // only cast to float for int overflow Calling ceil or floor on

Re: [PHP-DEV] [Pre-RFC] Improve language coherence for the behaviour of offsets and containers

2024-03-17 Thread Rowan Tommins [IMSoP]
On 11/03/2024 12:52, Gina P. Banyard wrote: I would like to get some initial feedback on an RFC I've been working on for the last 5–6 months. The RFC attempts to explain, and most importantly, improve the semantics around $container[$offset] as PHP is currently widely inconsistent. [...]

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-17 Thread Rowan Tommins [IMSoP]
On 17/03/2024 00:01, Ilija Tovilo wrote: For clarity, you are asking for a way to make the "virtualness" of properties more explicit, correct? Either more explicit, or less important: the less often the user needs to know whether a property is virtual, the less it matters how easily they

[PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Bob Weinand
On 17.3.2024 13:23:04, Marc Bennewitz wrote: Hello internals, I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Do to Easter weekend the vote will run for two weeks and two days until Tue the 2nd of April 2024. Best regards, Marc

Re: [PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Marc Bennewitz
On 17.03.24 14:10, Tim Düsterhus wrote: Hi On 3/17/24 13:23, Marc Bennewitz wrote: I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Please also update the Status within the RFC itself and move it to the correct section in the RFC

[PHP-DEV] Re: [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Tim Düsterhus
Hi On 3/17/24 13:23, Marc Bennewitz wrote: I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Please also update the Status within the RFC itself and move it to the correct section in the RFC overview at: https://wiki.php.net/rfc Best

[PHP-DEV] [RFC] [Discussion] [VOTE] Rounding Integers as int

2024-03-17 Thread Marc Bennewitz
Hello internals, I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Do to Easter weekend the vote will run for two weeks and two days until Tue the 2nd of April 2024. Best regards, Marc Bennewitz OpenPGP_0x3936ABF753BC88CE.asc