Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113356 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70893 invoked from network); 3 Mar 2021 19:40:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2021 19:40:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4D5081804C0 for ; Wed, 3 Mar 2021 11:30:42 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 3 Mar 2021 11:30:41 -0800 (PST) Received: from wafer.home (unknown [IPv6:2a02:1205:5053:a220:edf7:4eec:c207:9a79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 324D2150ED09 for ; Wed, 3 Mar 2021 20:30:39 +0100 (CET) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Wed, 3 Mar 2021 20:30:38 +0100 References: To: PHP internals In-Reply-To: Message-ID: X-Mailer: Apple Mail (2.3654.60.0.2.21) Subject: Re: [PHP-DEV] Don't compare zero exponentials in strings as equal From: cschneid@cschneid.com (Christian Schneider) Am 03.03.2021 um 19:21 schrieb Stanislav Malyshev : > Nobody who applies =3D=3D to strings and expects it to work out as = stri g comparison is doing the right thing. If you apply =3D=3D to = hex-encoded hashes, that code is fubar, and fixing one particular corner = case won't rescue it. So I wonder if fixing one particular corner case = while leaving many others in would do much. Just brainstorming, but following that logic, if we would like to remedy = this in the long run: a) Should =3D=3D with two strings where one (or both?) of them is = numeric cause an E_NOTICE or E_WARNING that =3D=3D=3D should be used? b) Should =3D=3D with two strings leave them as string? Possibly after a = period of notice/warning as described in a)? I haven't really thought this through but I still wanted to throw it out = there. I'm sure you'll tell me how foolish I am and why this is a very bad idea = ;-) - Chris