Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110288 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56322 invoked from network); 27 May 2020 18:11:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 May 2020 18:11:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AEE29180561 for ; Wed, 27 May 2020 09:52:27 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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, 27 May 2020 09:52:27 -0700 (PDT) Received: by mail-qk1-f171.google.com with SMTP id b6so79646qkh.11 for ; Wed, 27 May 2020 09:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=19lurwCHmJO+lZmDLfKOqJlMhzq1qBlc5TwIQAbreCY=; b=cn2zyVmAtimfPJJft88/AomoZDa/TKbRCNyI8Fvawk8OvTO284/Ei1P4loiBE2abZY BK7x+qX9zSxnX3uCcn6tKFIBdFRDAprZnXUI6zTPQLUZDPErTUgxatdigPP5w2Dh2RjG nehvOVJBTBETvQfgC2Pb8dlJDwLKZE7rE3GpXRtZoArGnf6PleCOpN0/sNcbfcUsxwQe 1pGzJoGz94zsIFnBgPJbK3SKX2yXLFoD1t4ukF4DZHUNWCx0kp3RZN5NWWaGKVVcxG72 nt9kFoRhX7j25m0SloEptUotJ4ofzeec0iSEw2Xu5Ytx08FhD70fGN7Tb9FK6YStZsNO 5yMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=19lurwCHmJO+lZmDLfKOqJlMhzq1qBlc5TwIQAbreCY=; b=hWR4V6viVE7Dn6PTFBCWtDYUi9n+TPykuyAwzx/CfvVAy+v+HiCFh5hY7KPQRe+SsG ieuHDO8t4sjR5SaF7eJOWRjTP0ZUq6KQWPa/yNxLUlz1XJ0jhxUGUnQf/6l44RJg18Hc QkfigAjSuFZoxys6gHiuitFnkC88xGhOuaU/ZgH9S/+VxFqzUZv5KvCafGUeNo7EiOfO b0n0jGtW8/QlnhRJUdz+OR0civFYlvIQ/6cNX55DACqtj1LKGrNpr82L3jbqcvQonE5C njuLn7VaCfHVQrPScl7g1HYHnJ51BNQpEKllQNBtJoIDwFZlxMjIy0tnQk12h79SnXLB mHwA== X-Gm-Message-State: AOAM532dXAMP6i8YFlo6+fP7w3mzRTxN5kLU/TCwWAlmGzBo6awvA+Aw nClJqRO00BemAnXVrX3aM2/r9A== X-Google-Smtp-Source: ABdhPJyHCSpkEQadzugpNIz6HldgX2lU1EpUdVulzCaFwxLTBTTEEzEthNrJcyWvTGaGfHdAc+upQg== X-Received: by 2002:a37:a3d5:: with SMTP id m204mr4452337qke.13.1590598344038; Wed, 27 May 2020 09:52:24 -0700 (PDT) Received: from [10.10.42.56] (h96-61-170-50.lvrgtn.dsl.dynamic.tds.net. [96.61.170.50]) by smtp.gmail.com with ESMTPSA id t20sm1200124qte.78.2020.05.27.09.52.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2020 09:52:22 -0700 (PDT) Message-ID: <1040F01D-9A1F-4214-89B0-F5730114F033@benramsey.com> Content-Type: multipart/signed; boundary="Apple-Mail=_E4D92513-99E6-4F3A-8037-81A573576266"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Wed, 27 May 2020 11:52:21 -0500 In-Reply-To: Cc: PHP Internals To: Arnold Daniels References: X-Mailer: Apple Mail (2.3608.80.23.2.2) Subject: Re: [PHP-DEV] [RFC] Strict operators directive From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_E4D92513-99E6-4F3A-8037-81A573576266 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 15, 2020, at 17:03, Arnold Daniels = wrote: >=20 > Hi all, >=20 > I'd like to restart the discussion for the strict_opterators RFC ( > https://wiki.php.net/rfc/strict_operators). I=E2=80=99m having trouble wrapping my head around this statement: > To compare two numeric strings as numbers, they need to be cast to > integers or floats. As an example, the RFC shows: "100" =3D=3D "1e1"; // false (int)"100" =3D=3D (int)"1e2"; // true But this is identical to how PHP works today. I think the identity operator is more expressive in this case, especially to show intent. > The function of the =3D=3D=3D and !=3D=3D operators remains unchanged. So, while `true !=3D 0` throws a TypeError, `true !=3D=3D 0` continues = to function as it does today, without a TypeError? I find this behavior confusing and unintuitive. I can see the value in what the RFC proposes (strict type comparisons), but I think the behavior proposed still needs work. While I understand it=E2=80=99s opt-in on a file-by-file basis, I don=E2=80=99t think = changing the meaning and behavior of existing operators is the right approach. Maybe if we could introduce new comparison operator symbols? But I=E2=80=99= m not sure what those symbols would be. Cheers, Ben --Apple-Mail=_E4D92513-99E6-4F3A-8037-81A573576266 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCXs6axQAKCRCwLZeYnIwH Gx7YAP97b+lchN5Ij/cbGbZNxfG4IYSgSaUa3SyNM7tbgXJ0gwD/eZG4PsrYexiH PuPx+bgqM5YBHXP5zYBfp+EY6pxDHYg= =M4rO -----END PGP SIGNATURE----- --Apple-Mail=_E4D92513-99E6-4F3A-8037-81A573576266--