Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111072 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97580 invoked from network); 17 Jul 2020 17:42:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jul 2020 17:42:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 219121804B3 for ; Fri, 17 Jul 2020 09:35:15 -0700 (PDT) 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,HTML_MESSAGE, 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-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 ; Fri, 17 Jul 2020 09:35:14 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id b25so13400573ljp.6 for ; Fri, 17 Jul 2020 09:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lhYBf58od6yw/qITSWeF2FN664t9GD97OupW857SBtY=; b=Twa1DBHpApyIzS9H7F88nXaInkDNRg8hQUAgWt0yfKSbbXWxrnnrZ6w+aYQJivVolS LFjL3iGT+K/rXzpwb0bgTU4jECmHl90DWKSUIvP4FGuqu5DyPS4+5Mw4Kpw0FAMfJCS8 FRmEzaAc0o/OFX/aGf3Pz06SzghDYEnpMooUM8017dobGxdSa8Ki6h3kTBAPKT9b3PM9 hGjb5gtGNd32ieegGcneD4Wfnced2P/FrYwwGqXZFyc698KDrMK9cjQQiJ8Rrl3nKNGm dK9bLcZy1Ptu7wZSyLH1Sv161yHzjc37kq+1CoXOzIlkomw+dDrzbOXq7Flt8eCfNfew 1ceA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lhYBf58od6yw/qITSWeF2FN664t9GD97OupW857SBtY=; b=ptxwJYoic4RHJ1HPUOq/Uhf3r9y8aiuZxVuN8ZeX4ELPOPohDcVZ3j8MfX+s6iLQUf hgfSDE9vBsK3QYvwLwgfMhdsFOXvc1NMpBxXvSapu9DakKBwQ9b0tczkkXJIzX1Z9zTT 6UJoW7WPGbKS0lilOW+mA2QfYEr3sSIzrE+5WmO1WXs00qyylRSlGEZeVBuhZO6VM6qr nNZVefsnSAFsxjjmi05N7jX8+d4YcH+hX94gpJAS9ditTu8Pv9jEDGTj2VnzjwDEP8O3 HXGqo0xj0REYboFg7Rg9C0qeifpoGVZllXpjzB5qVJofkqdfQYKN5pPntRdnZzfTTQaP tirA== X-Gm-Message-State: AOAM532weuPc3ve+RX30k+UQYTSHQQjfbXG0wCebYCcmWROl3ZYlqiyO JDsl8N7UCfcyv6+fJXL7zJ+ko4Kz6Wsot6l66DY= X-Google-Smtp-Source: ABdhPJw60igd7QcRWFIS9GCBg45owNImztl+9V+8N7SfOx0Pv+Zr0Q5gl6AQCHhL8AMJQDjcKcSceDEfwl+WJNEu/uE= X-Received: by 2002:a2e:8707:: with SMTP id m7mr4726362lji.350.1595003711404; Fri, 17 Jul 2020 09:35:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Jul 2020 18:34:55 +0200 Message-ID: To: Benjamin Morel Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000a240cf05aaa5bd13" Subject: Re: [PHP-DEV] [VOTE] Saner string to number comparison From: nikita.ppv@gmail.com (Nikita Popov) --000000000000a240cf05aaa5bd13 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 17, 2020 at 6:29 PM Benjamin Morel wrote: > Thanks for this RFC, Nikita! This is definitely a step in the right > direction, and I can only hope it will pass. > > One question: > > > (...) by using a number comparison only if the string is actually > numeric. *Otherwise the number is converted into a string, and a string > comparison is performed.* > > Is there a reason to perform another comparison as a string, when the > string is not numeric? I can=E2=80=99t think of a case where the string c= omparison > would match. > Comparisons are not just about equality, they are also about ordering. Nikita --000000000000a240cf05aaa5bd13--