Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113362 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26010 invoked from network); 4 Mar 2021 09:13:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Mar 2021 09:13:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A15841804D3 for ; Thu, 4 Mar 2021 01:03:57 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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:03:57 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id i9so7331338wml.0 for ; Thu, 04 Mar 2021 01:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=YNdhgUg9eEJgY4vFxx/us+QwGMAI3PegRRyqEiZ12JA=; b=Oj0ghOqZnV9kBefP32hREcYxwK02L20P9Nv5fSqCopMoc7dML7R80tCAqACW8nOw8X mJgfZxxnuKBa7jtrqp1JxUDO86dwkaOo6SV9iExqR+OcKlVaHCDwBwrXmcw8MrSf9Qak mwJxnIEGJmfmBe17KwIBaBWxl5bjSuJrnjTvPRXIV52lpnfYaGIoKiAScTMclXe/ySvY UnP/I9oaSuVLv05jWEQVTDfYxCKn1PBFwRX4fr6KNxrma/rbdD4fTeI6+7dZ7AaNI2zb MzDJWG4b6A4RZpwZrQannacB69MS7FreFwJ35svcQXeDT6luYEcNJ3IKermfnTosPCZ6 G1dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=YNdhgUg9eEJgY4vFxx/us+QwGMAI3PegRRyqEiZ12JA=; b=ZqYjTS57ucNO9Qp3KTvdrrav2fqGCWCrd8Sm7PzF5dJKY6Zs8XY7ACZTkcQkNPDvkC ReX5yXTJofnnhC0ET9/iqr2vNT0En+PU61nws8RYtq5F0s7Bn2TnCHBfgcq8m4fOYUMZ hpgteGEE79bDebu60wLju7XoJvPEK3qBTff2/QQhIP6HIAMaGPBCEflfIuc6z7Q1tC1I lDMvJD1zWsFrt2C3gWwSBH7ZcdnRwQgpZCdHajUXZ2f002C2rmts+xf+6YE0EJ39Zywn VWmBqkaA09SarGnKgybgaHdWFqh2mhwbKSqe4R6MoM3uWEhK90/gfhC3EWvcxIZ79Ewy GdtA== X-Gm-Message-State: AOAM532AI+2KtVcyoliouVWpe3DmNLtIdUeQPAy14nzsH+Uvza3fxgFo JudJyfgqOgSHsvosQWcqOxzIEDqqyGQ= X-Google-Smtp-Source: ABdhPJxKKMYT5WV9lTp00MTFTT4ROOQ9MECViHuXdO1LSNA94xIfNWYmlb55tFscs/2fZCAt2uSdWA== X-Received: by 2002:a05:600c:2301:: with SMTP id 1mr2959590wmo.36.1614848633408; Thu, 04 Mar 2021 01:03:53 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id f14sm8554566wmf.7.2021.03.04.01.03.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Mar 2021 01:03:52 -0800 (PST) To: internals@lists.php.net References: <424A5E98-2110-4AFE-9C53-8636A6140313@benramsey.com> Message-ID: <189f1b60-5775-5a6b-ccb6-ff239ba30718@gmail.com> Date: Thu, 4 Mar 2021 09:03:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <424A5E98-2110-4AFE-9C53-8636A6140313@benramsey.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Don't compare zero exponentials in strings as equal From: rowan.collins@gmail.com (Rowan Tommins) On 04/03/2021 00:37, Ben Ramsey wrote: > On Mar 3, 2021, at 14:25, Kamil Tekiela wrote: >> when both are strings then chances are that this is an error. > > Except when comparing two values from sources known to provide numbers as strings, such as form input and database results. :-) The juggling only makes a difference if the two sources provide different representations of the same number - "12345" is equal to "12345" whether you cast both sides to int or leave both as strings. Regards, -- Rowan Tommins [IMSoP]