Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127009 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 426011A00BC for ; Tue, 1 Apr 2025 12:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743510868; bh=P1Q4ZjVgj8B1gJbVcVXKNyGS/wdCtcaFn4x/zPfJXU4=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=DARCks8my88EDibCVaw1Ddm4DaaXEMvgqnc9+tMjTQOKuoh6kquLo0dFiblQkK+Tx jQsky6QBuvRcd9K+/ZOn67DDZ2G0uDx4BSifKCq+K88OnWl5+QW4jKWx/T8FHfMcSH KMaKsraUAWTzN8og8PxrycPyrQ3i2yfvuFBaniYS5i/vg5iTfis9pHlLJqD0+u9I6d +RpQRIAUIKkk4eqTZcWAlpMVxfQ01XQl7ulv11be7Owy9vBDISKa2E+zvNO64rP7gC WyBttePGVfnZ6K4k+yd81QYDqRr8jNTHeFChWPb83Z5aBRzhJMbKI826GL3PAveHt3 qnr8dE0yaAE0A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5BFE31801C7 for ; Tue, 1 Apr 2025 12:34:27 +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-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 12:34:27 +0000 (UTC) Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-399737f4fa4so2681524f8f.0 for ; Tue, 01 Apr 2025 05:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743511012; x=1744115812; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=/KX8gg6XZZF9yRrlhv1MAgCBu4nt613DNOoohi8H3oM=; b=m8aEiTfoWs3qed8HNNZ3xQe4X88Q8fl43B1/2FhqGLW/v5ROI7Ht1lKvNLtIIlIoef JkJKAaF+ShbI+0eGRHrR6bO9dGUxCgdSHwbF4PwVNydUZQBt7AvPYVhljTl15zw6smOM qZemfaQO7euhU5fFk9TRdhiCaWht3tfm+9JoAqoLWGop12Z43Sb+7qpbXaManCOalKLo hVNbq1Pr/cyNKpF1HgJEsskR+nz0Cr1znQGSOfEzP4UPpwH/EOmm4qId/GddsCg2UIRj BZYfEx+TzNWFlouWiKL6BCjfNH/Uq/9mr8HLQ/TxPcXO1ObfiwN4BX8BsA2LjJdxuZSs 84ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743511012; x=1744115812; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/KX8gg6XZZF9yRrlhv1MAgCBu4nt613DNOoohi8H3oM=; b=XrGh8evJM8/SCDoR7gfADmgM1mpo0W55q6/tJX43HjpjsUpI9L5QPL9vSe9usTyzfL kTu3WrSYef0C6PU/OSoGQg20PnlpOlk+VGU24XoRSSHgR476fpJC2xqU1renN5zyywLx kKTt5/OAHzd4BEeWIfD009f4XKbOUvB+t3lTS0xQN9XhrVNeNeb7mgzFmCPX+2DenpLx qu09PmyYuCN/tbHXsedwoDu8lKgvwKqpNzWpffHAP+D7s0KWCL90bOSCMqYQMG0y6NEd 3prOr7IoJQ1oOHg5ViB23OwZUNCVz0YR8UTASKCONzPZhd1jCzb/22d5HYZRGVkwwneq 51bg== X-Gm-Message-State: AOJu0YxD+UAVXk3asktDzuD/By3Mc01xE5CGGhF5Ms3aCSduXyVb+NjB eSkmNylEO6wD/tGC0fzscGkTQjjKbsa3v3yyPXR9K6RtoSbqmm+E X-Gm-Gg: ASbGncsS0smhaCdUtBkAPLuiHDsOA3hG8/jXJtywQNppG0Fs4Mh98PKb6SYngcPJBTw vIYLsahAuxftz7XrN/W5h6PrUTJz0cMB1EuziZ160qLXGhKKnfnAsC8jiCPLbnerTvd5Oq3rwX3 BfmLybUP1nUz6fXZgfQALk+5LnNfWnfIiE968tmPx/KYYhHGxWVAp5+znmtDSFfeRhDCky986HI Gu+vmkE9+QI9Iz9oaZDAJNduw9VfjB+FTTGQ8895BHbicoYlOU3Rib0ohVcW1zvWggvtGWHP4M/ KYe6SIFVc1oV2NPxs+Ke7XIRPGXyFxdzr911mlR29phYzGPWuJj69MTPuvAj+ow= X-Google-Smtp-Source: AGHT+IErcvY5rsjKR/YnpHXzzb+K4o+TOSp28Zdvi3euew4VaQYEItt5HbIQectSm4kmih7SqM9T0Q== X-Received: by 2002:a05:6000:4027:b0:391:4835:d8a8 with SMTP id ffacd0b85a97d-39c120cb59cmr9919466f8f.1.1743511012338; Tue, 01 Apr 2025 05:36:52 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d82efdff2sm198229585e9.17.2025.04.01.05.36.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2025 05:36:51 -0700 (PDT) Message-ID: <50B7520A-0FC5-4660-AA5B-2E8D05EA4230@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_ED221E7F-C49D-4B27-AD9B-80446C8D43D0" Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: [PHP-DEV] [RFC brainstorm] Approximately equals operator Date: Tue, 1 Apr 2025 14:36:40 +0200 In-Reply-To: <4a3c6ce7-102d-4cfe-a7a8-35630715b870@gmail.com> Cc: PHP internals To: Niels Dossche References: <4a3c6ce7-102d-4cfe-a7a8-35630715b870@gmail.com> X-Mailer: Apple Mail (2.3826.400.131.1.6) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_ED221E7F-C49D-4B27-AD9B-80446C8D43D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 1 avr. 2025 =C3=A0 00:03, Niels Dossche a = =C3=A9crit : >=20 > Hi internals! >=20 > 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. >=20 > [...] > 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"! >=20 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= --Apple-Mail=_ED221E7F-C49D-4B27-AD9B-80446C8D43D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Le 1 avr. 2025 =C3=A0 00:03, Niels Dossche = <dossche.niels@gmail.com> 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

<= /div>
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
= --Apple-Mail=_ED221E7F-C49D-4B27-AD9B-80446C8D43D0--