Re: [RFC brainstorm] Approximately equals operator

From: Date: Wed, 02 Apr 2025 07:33:27 +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
On 01.04.2025 00:03, Niels Dossche wrote:
We live in an imperfect world, and we often approximate data, but neither == nor === are ideal comparison operators to deal with these kinds of data.
I am late to the party here, but in all seriousness when I read the subject my initial thought was that this was gonna be about adding a ~= operator to clearly show intent (does the same as == though), allowing us to simultaneously deprecate ==. Then in next major we can make == mean strict equal, deprecate ===, and you're left with == or ~=, which seems cleaner to me as you know nobody typed ~= accidentally while they meant ===. Anyway, while (maybe..) a less goofy idea it is probably just as unlikely to make it through BC concerns. Best, Jordi

Thread (17 messages)

« previous php.internals (#127024) next »