Re: [RFC brainstorm] Approximately equals operator

From: Date: Tue, 01 Apr 2025 12:36:40 +0000
Subject: Re: [RFC brainstorm] Approximately equals operator
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


> Le 1 avr. 2025 à 00:03, Niels Dossche <[email protected]> a écrit :
> 
> Hi internals!
> 
> I'm excited to share what I've been working on!
> I had an epiphany. I realized what we truly need to revolutionize PHP: a new operator.
> 
> [...]
> First of all, if $a == $b holds, then $a ~= $b obviously.
> The true power lies where the data is not exactly the same, but "close enough"!
> 

Hi Niels,

A major issue with the == operator, is that it is not transitive: https://3v4l.org/dISMi

I firmly think that it should corrected this with the new ~= operator: it will make
approximate code easier to reason about.

As a bonus, with this amendment, the principle of explosion could be used to severely optimise the
implementation.

—Claude


Thread (17 messages)

« previous php.internals (#127009) next »