Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127010 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id E41BB1A00BC for ; Tue, 1 Apr 2025 13:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743512653; bh=oN16uqU6nwf9k2yiU2N0F4BIGGB0Rxbt+AzdJ9WONHU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gvCC3vkHWfI/kmng6hT/+IF3zIPZ1xhJJiBZZLeFHwik3CZZM3g3wiG670sRN67KL RbbScrj2z8+IE7IZVYBP46BcvD2Dtle7b3J3xDK6+ft2vNZsP7b8D6oNEHBr98uhs4 TcP26EatB2iHhaln/7t49xPY01GFxWW9SpV9k9c3pzavmmDpw8bsBDMkAnnM2pvow3 cS4BjrJRHdNojCUTul8x4zR07+j91Pk6n3nL/vhKGZwDJ6roa/ZOWEtt4Pe4gD7i3Q nePKEUj2fEOLlg+dtYkwI1uIVIyJUGUt/NkYPUL44+wGcw16V/71ZZ/ypV8maH5lji ZKk3B1zAUynvw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1397E180034 for ; Tue, 1 Apr 2025 13:04:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 1 Apr 2025 13:04:12 +0000 (UTC) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-abec8b750ebso866287066b.0 for ; Tue, 01 Apr 2025 06:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743512798; x=1744117598; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oN16uqU6nwf9k2yiU2N0F4BIGGB0Rxbt+AzdJ9WONHU=; b=eWA5SzVkBbPWurSa9lclTQPIhzkW5Lfm9sFdor1LkbrU7qaUbVgmQPVzGLMVRg6ZyP fxHqjEwT9t1KTCApB7i1dWYflqXbE9vPuEl0PlikkRl9ToUUOwL+OEoO66tooxb4r/pE GKEgVPt6hHdSUzjFsw1cp9NJk1tGkCpMJSfP4F5c+mcnVG4nNrtlBqTQEhWJgU4QhM+M IMTRJSrVM4wDZejMq1Htg2UruRtYmlmB6YwKiWQT8fYKrV5kzPW0cmGaNRDG21/AkdTT ZLagtyI4LsgMZtVKxEU7SXOwYF5ZG5uPMVYHJs2xhP68Od3USv174LWmJQT8Tw5yXe77 ri2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743512798; x=1744117598; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oN16uqU6nwf9k2yiU2N0F4BIGGB0Rxbt+AzdJ9WONHU=; b=RGEidVs9dxpqOVW7L1gxJfru7DSINlobY1uBsI0XfwRwUTgb4+Ukcn4GoUa+c+m73I Lw9bkIQdKJkSBn6Z5ODugpgW/6ZpVSP52o0J1el2CxqeeIIsFlfMTc0b4osg422ssPfF cMZ2qm7eJ5o+xEayRF2bJCCFpkjZg0ioEjcYxNGBiVjO5KWdBuLljWsTN9f1wSh3mKka W3oBdL/3+cFzn8+E3ODpti60FPgW3V+QCnuteQu/TjXnXqlL+hlzJfCjoXfv1iCp8uKd cAmWblp5jvE5QPX4YJoUc3p4qJgTcTrFUTayvDHswo7TvKgKHaQ/MtxrP2fQ5PZe03Ft 8EuA== X-Forwarded-Encrypted: i=1; AJvYcCUxFPPHUmDwh2UAyHSkddhHn5wMo4q/eZlI6PLjIGlom3/okbc7+358ECyIDrKn0s8LHYNyTvzeAWg=@lists.php.net X-Gm-Message-State: AOJu0YxiVgGaZq3X7SZlJthv4G0cRFxkrnSB+qe3gPz1uAJ+fy22UAH1 xW3wOIj9ov6+avPcS8Vyn3xSAW2etbAXydAqWNAgGqziTqtLxUXPHr8XQZvT3ECusRh6HwKgGWs VOR9RF73lyMKZVsIs+L6nuMbGUJk= X-Gm-Gg: ASbGncv2e4zzqzofNl0B0lKtTBGoCNbjl5YUFSmy8M97xCDVaRKr5SsR6BY0Fyo+qGN 5z4OTljwlkS6qD8Sp/PyhXKYJEkBjgmdJsQjWj59SLlsN3Oi/XiOr4bRnYqow8T+pIDGTgdeVgi Qlntu4nXDYZ6CRA5xITgXY+zsCNQ== X-Google-Smtp-Source: AGHT+IGxSntlGfLgZOea4p4isLndkiMv0urMBpq6DVE3piHRauhrklcdBU2OwqTDrrMgooHLwYYSTd1W3uqY/dcpTZY= X-Received: by 2002:a17:907:97d6:b0:ac4:4c5:9f26 with SMTP id a640c23a62f3a-ac738be3d3fmr1075684966b.38.1743512798001; Tue, 01 Apr 2025 06:06:38 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <4a3c6ce7-102d-4cfe-a7a8-35630715b870@gmail.com> <50B7520A-0FC5-4660-AA5B-2E8D05EA4230@gmail.com> In-Reply-To: <50B7520A-0FC5-4660-AA5B-2E8D05EA4230@gmail.com> Date: Tue, 1 Apr 2025 16:06:26 +0300 X-Gm-Features: AQ5f1JrqXj1lKV3YZ0nVBupreAEwn9PYzujXORCPcK2b8PznbAV1b1Ls2VWN_-s Message-ID: Subject: Re: [PHP-DEV] [RFC brainstorm] Approximately equals operator To: Claude Pache Cc: Niels Dossche , PHP internals Content-Type: multipart/alternative; boundary="000000000000fc84f90631b73470" From: i.miroslavov@gmail.com (Iliya Miroslavov Iliev) --000000000000fc84f90631b73470 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Claude, in your example if `var_dump(false =3D=3D true);` is `false` what i= s `true` in this world? It is `true` that `false` is not `true`. On Tue, Apr 1, 2025 at 3:39=E2=80=AFPM Claude Pache wrote: > > > Le 1 avr. 2025 =C3=A0 00:03, Niels Dossche a = =C3=A9crit : > > 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 =3D=3D $b` holds, then `$a ~=3D $b` obviously. > The true power lies where the data is not exactly the same, but "close > enough"! > > > Hi Niels, > > A major issue with the `=3D=3D` operator, is that it is not transitive: > https://3v4l.org/dISMi > > I firmly think that it should corrected this with the new `~=3D` 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. > > =E2=80=94Claude > --=20 Iliya Miroslavov Iliev i.miroslavov@gmail.com --000000000000fc84f90631b73470 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Claude, in your example if `var_dump(false =3D=3D true);` = is `false` what is `true` in this world? It is `true` that `false` is not `= true`.=C2=A0

On Tue, Apr 1, 2025 at 3:39=E2=80=AFPM Cl= aude Pache <claude.pache@gmail= .com> wrote:

=
Le 1 avr. 2025 =C3=A0 00:03, Niels Dossc= he <dossche= .niels@gmail.com> a =C3=A9crit :

Hi internals!
I'm excited to share what I've been working on!
I had an ep= iphany. I realized what we truly need to revolutionize PHP: a new operator.=

[...]
First of all, if `$a =3D=3D $b` holds, then `$a ~=3D $b` o= bviously.
The true power lies where the data is not exactly the same, bu= t "close enough"!


=
Hi Niels,

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

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

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

=E2=80=94Claud= e


--
Iliya Miroslavov Iliev
--000000000000fc84f90631b73470--