On Tue, Jul 2, 2024 at 1:20 AM Rowan Tommins [IMSoP]
wrote:
> On 1 July 2024 15:37:49 CEST, Alexander Pravdin
> wrote:
> >I personally support the movement from the current "plain-text
> >template-first" language to a "coding-first" language, where f
Sorry for getting into this hot topic. Just wanted to add my two cents.
> Really, the only targets we should be looking at, IMO, are:
>
> 1. Package-level visibility.
> 2. Giving the compiler/optimizer/JIT a larger "scope" of code to
> compile/optimize at once, so it can do smarter things.
>
> I
loat parameters
are converted to decimals implicitly according to the conversion rules
mentioned above.
I hope this version of the design is closer to being accepted by the
community. Please share your thoughts.
--
Best,
Alexander
--
Best regards,
Alex Pravdin
Interico
On Wed, Apr 10, 2024 at 1
On Tue, Apr 9, 2024 at 7:52 PM Derick Rethans wrote:
> Adding a new native type to PHP will create a large change. Not only is
> it "just" adding a new native type, it also means all of the conversions
> between types need to be added. This is not a small task.
I understand this :)
> If you wa
On Tue, Mar 19, 2024 at 5:35 AM Rowan Tommins [IMSoP]
wrote:
> I think a reasonable number of people do share the sentiment that having two
> separate modes was a mistake; and neither mode is actually perfect. It's not
> about "making it on by default", it's about coming up with a unified
> be
On Mon, Apr 8, 2024 at 5:06 PM Rowan Tommins [IMSoP]
wrote:
> If we ever do want to make decimals a native type, we would need some way to
> initialise a decimal value, since 1.2 will initialise a float.
My original suggestion was:
- Add "default decimal" mode with the "declare" statement in t
On Tue, Apr 2, 2024 at 9:18 AM Ilija Tovilo wrote:
>
> Hi everyone!
>
> I'd like to introduce an idea I've played around with for a couple of
> weeks: Data classes, sometimes called structs in other languages (e.g.
> Swift and C#).
>
> ```php
> data class Vector {
> private $values;
>
> pu
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
>>
On Thu, Feb 8, 2024 at 6:25 PM Григорий Senior PHP / Разработчик Web
<6562...@gmail.com> wrote:
>
> PHPStan is out the case.
>
May I know why is it out?
I'm actively using it in my projects and it helps me a lot to not
relax and write safe code. It also helps a lot in cleaning up legacy
code. Som
On Thu, Feb 8, 2024 at 4:02 PM Григорий Senior PHP / Разработчик Web
<6562...@gmail.com> wrote:
>
> JIT I've had this solved, not only the application, but a way to.
>
> Am sharing my experience without labels "bad", "cood", "truth" or "correct",
> like you did.
>
> Your arguments are based on you
On Thu, Feb 8, 2024 at 2:29 AM Григорий Senior PHP / Разработчик Web
<6562...@gmail.com> wrote:
> I still don't understand why the problem is signature and moving a simple
> throw statement to return type, and then rewriting the catch statement to
> oneline-r.
Sorry for answering not directly to
On Wed, Feb 7, 2024 at 12:00 AM Григорий Senior PHP / Разработчик Web
<6562...@gmail.com> wrote:
>
> Sending you private emails made because "answer" button in Gmail selects
> only you to receive.
> Sending you private emails that don't even read signs to me you don't need
> my answers and have no
I would also suggest supporting readonly classes and creating special
attributes to help map data fields to constructor arguments. Something like
this:
readonly class User {
public function __construct(
#[PDOField('user_id')]
public string $userId,
#[PDOField('user_nam
>
> So you want to introduce a SAPI that doesn't work with any of the existing
> HTTP solutions people use that only supports HTTP requests? Or am I
> misunderstanding something?
>
> This sounds a bit like you want to merge in a tool that is designed for
> your personal product directly into core.
On Wed, Dec 13, 2023 at 6:11 PM Robert Landers
wrote:
I just ran `apt install php8.3-decimal` and tried this:
>
> $a = new Decimal\Decimal("1", 2);
> $b = $a + $a;
> PHP Warning: Uncaught TypeError: Unsupported operand types:
> Decimal\Decimal + Decimal\Decimal in
>
> So, it appears not.
>
I've
On Thu, Dec 7, 2023 at 3:36 PM Alex Pravdin wrote:
Ext-decimal:
> ...
> - Workaround: implements the Decimal class that allows basic regular math
> operations.
>
I just found out that under PHP 8.3, basic arithmetic operations on the
Decimal object variables are no longer supported and cause Typ
On Thu, Dec 7, 2023 at 11:36 PM G. P. B. wrote:
- Objects are always casted to true, GMP(0) will equal to true.
>>
>
> This is incorrect, GMP object do _not_ support casts to bool
> See https://3v4l.org/LHpD1
>
This is weird. Any PHP user would expect that a zero number can be easily
casted to b
On Thu, Dec 7, 2023 at 11:27 PM Jordan LeDoux
wrote:
You are going to run into some very difficult corners on this one. For the
> last... 8 years i guess? I have been working on an arbitrary precision
> library for PHP in userland. It utilizes BCMath, ext-decimal, and GMP,
> depending on what is
>
> Someone tangential to your proposal, have you given any thought to
> implementing this similar to how Python treats numbers?
>
Unfortunately, I don't know many details of numbers treatment in Python...
In Python, integers have unlimited precision. I’m not sure how they store
> the values int
On Thu, 27 Apr 2023 at 21:09, Rowan Tommins wrote:
> I still don't think it justifies the "mind-blowing" and "band-aid"
> hyperbole, though. It could give better errors, but the solution is still
> "never initialise decimals from floats", and that would be true whatever
> was built into PHP.
You
On Thu, 27 Apr 2023 at 07:03, Rowan Tommins wrote:
> You have to load the value somehow; bcmath accepts strings directly, so
> parses the values each time, which isn't very efficient; but php-decimal
> uses strings to construct objects, as does GMP. I guess the other option
> for a decimal would
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
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
23 matches
Mail list logo