Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127024 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 09D111A00BC for ; Wed, 2 Apr 2025 07:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743579060; bh=i7iQ11Lhu0WwYcUfGU0kgbUy75hzBsxGJt2wGOOgwuE=; h=Date:Subject:To:References:From:In-Reply-To:From; b=DroWOY71yJRKD5n9/tYF3bsAomKjuhUF93EIIewnlRplUd1G/0CWed99+Y+QD9JRg xZaFgejoMD/wi7esvAeCN44E5Im3E5+eNa0clOsPDLgnE+JhQLPPhkg0ondTjy9i+b S0moeakv6IDHFMDkMQmyRO/wIUnwjR70iB4uZLpL1muT3qXt4ITbWQF2iuVR3MLqzw 8xR38IBGuegH/hFYafkdImi/lPrYkeTrN5L26UVEa3v53tmhh3VRsE8cxecXpJY7UQ LR64oUpsgqEKvecXmjakpx7s3MXsImNl09i63jzzTadDpgjDajppwSha06nkwG0037 6+Felo4yvYOPg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D987418006C for ; Wed, 2 Apr 2025 07:30:58 +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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-f54.google.com (mail-ej1-f54.google.com [209.85.218.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 ; Wed, 2 Apr 2025 07:30:58 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-ac2aeada833so113567766b.0 for ; Wed, 02 Apr 2025 00:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seld.be; s=google; t=1743579203; x=1744184003; darn=lists.php.net; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=94NKJAoVixTJXJiDXUTrffekOnUBR3p2uil52kBsvmU=; b=Zg18Z8ZzgCB7XnvLMY4dV+15YNOtTSv1/XHgLXoFhKak8noDzT95QN30FWsH7yR2QS J4LvvlbIK3R/upmkZZGvHL5orZZ8JM20pbAqCLeiwOCMm5fv/s/vGs/kj2gcTpR8yiFy mRz63ggtp76ZTrwjwt7HP0JrgEIjaknVT6QC3jLg1xObCrJ0vlHKc+QpvmJaobiZggeL 32PrmrA+3w3HDBX1BUIlod0JgfRjs6q8lhhK6cmZnKMm1DSMEVNGxzhE6WGrK0sugv7S 9n4Z/YUK7m1M37+6XZQE7WhGqL8t3EMmuTd+IRtb4H9jisT+WBU4Si6MDhOzNIaaj5f/ 64Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743579203; x=1744184003; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=94NKJAoVixTJXJiDXUTrffekOnUBR3p2uil52kBsvmU=; b=cdlhILN6q7nxjmacaqjv9GQbcRQXG8VFPT2qhbwr71DbT4vtC1lstePfdXv0bxlMlw 6voz+chXTlDi5SDSExAA/ZSY0RKbgARWxevUnDbz4/yTRSIb5+RvU4VM800W7pEraAWy jjg2oZgxJEX5TFKLmvo0106KWwZ+hEKE3TQsQpy0P3ivj2MOZBUi7tM3tDTWx1XAs9m2 FXiuSh7LSfEzghI/ueZTd3j8Y+tXrCWCe3TzLrgl0xO7Y8R22W5xInqcq1ek16UToNed 65Rhl3cwKGNh0x4Q79AWFiY3LHvXEvaG8S5hAyLL5SMR7ikz4IHqF4/5BfBj6QtBiE7x cK/g== X-Gm-Message-State: AOJu0YzNYRg+MP1z4ygL5VxMTvxEEBCr+CxHvjNdxe2teGa+CMUvJ8Bo cGg6RZFSnSoz8XxFHGFWCet6h4Ux4rYx4eAJd3xNEdCdHxlzD7YWw6UL/jxZlSBoWxedHbDV9ks YYfg= X-Gm-Gg: ASbGncsnfFGz21fxpNkWK9sNoEgVZCoiJRnB/BW3McNHadQVCjpY6DoZbGybug6lu1p XsqVKCH0eMEpg+eHgbR1PXNXq/MTeaA9oTZU2ntZD3MjTUD5Pa6k6cXTTbEmuuJAjxFpEVeVRBd yR1l/q2crIUjaXHzDt7rJw2y0K2aXzuZhxV69ea0J7wtn5vkmq7Uh3ITblu7e55IXTkySWHLTzm p5zCZIos2cbqxTwdhCYtOO6w8OQg+6aOTGiZYZvyxGqunS5OFiihfoNxa1SwChzIYIthhZFYR1U RY4uYnONfrPbXxkOlAR0XbH2+P5uU/WisSMPRIFohqvmcXq29hl+muPPLNzeK2Rfpc4CfLTcCuZ AbOjjyAH7rYDy X-Google-Smtp-Source: AGHT+IF0M5EnctKqyYZVvnNTV77GwlgmswEuZpDJDtKBDKG4RSkjR6CUosktEBSD0RP4gbFlB3KzMg== X-Received: by 2002:a17:907:9484:b0:ac7:981d:b137 with SMTP id a640c23a62f3a-ac7a54d59a1mr89284966b.22.1743579202583; Wed, 02 Apr 2025 00:33:22 -0700 (PDT) Received: from ?IPV6:2a02:168:4b6e:0:b86c:50c7:3668:8c44? ([2a02:168:4b6e:0:b86c:50c7:3668:8c44]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac71961f3c7sm883295666b.94.2025.04.02.00.33.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 00:33:21 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------KYn390d6f51CZAwdfpP0i8aF" Message-ID: Date: Wed, 2 Apr 2025 09:33:27 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC brainstorm] Approximately equals operator To: internals@lists.php.net References: <4a3c6ce7-102d-4cfe-a7a8-35630715b870@gmail.com> Content-Language: fr In-Reply-To: <4a3c6ce7-102d-4cfe-a7a8-35630715b870@gmail.com> From: j.boggiano@seld.be (Jordi Boggiano) This is a multi-part message in MIME format. --------------KYn390d6f51CZAwdfpP0i8aF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------KYn390d6f51CZAwdfpP0i8aF Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
--------------KYn390d6f51CZAwdfpP0i8aF--