Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113364 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31978 invoked from network); 4 Mar 2021 10:03:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Mar 2021 10:03:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 03DE51804B8 for ; Thu, 4 Mar 2021 01:54:30 -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.5 required=5.0 tests=BAYES_05,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 ; Thu, 4 Mar 2021 01:54:29 -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 404A6150ED09 for ; Thu, 4 Mar 2021 10:54:26 +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: Thu, 4 Mar 2021 10:54:25 +0100 References: <424A5E98-2110-4AFE-9C53-8636A6140313@benramsey.com> To: PHP internals In-Reply-To: <424A5E98-2110-4AFE-9C53-8636A6140313@benramsey.com> 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 04.03.2021 um 01:37 schrieb Ben Ramsey : > On Mar 3, 2021, at 14:25, Kamil Tekiela wrote: >>=20 >> when both are strings then chances are that this is an error. >=20 > Except when comparing two values from sources known to provide numbers = as strings, such as form input and database results. :-) This would be a problem for leading zeroes and leading/training spaces, = right? Leading zeroes theoretically could happen in databases, leading/training = spaces happen in form input and possibly databases. Are there other 'common' cases? - Chris