Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110850 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51431 invoked from network); 6 Jul 2020 17:43:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jul 2020 17:43:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4725018055D for ; Mon, 6 Jul 2020 09:33:48 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,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-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 ; Mon, 6 Jul 2020 09:33:47 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id 17so42760504wmo.1 for ; Mon, 06 Jul 2020 09:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OexcqeFKFro9YzL0LA/HRe/mUIr6TjqNNYDzROq9USk=; b=puN/+eYHLxT851+dlKBu504dbzQHt4dNXt1VHCjl31+B46QUHHNIGCLePRkpv/D92g bKAYMdZN01HfIv8y6Lq36HkPfMnftCvQeDxZ0DEAEHahp6zR8lV/E/J6ip1NHMQfIotW YhS164UwRh2X02PApPjOrrLQe/bZti5qLfeD0lv/aaUqGCZPc9nQe5oLWAWNzmoQsQWd VkLCFLc2CvG7toe4y2dk4bQsV6RLiHnYox+gWUpemCNdcY1d0Q0gcOT2ug5UBO3hIZ/B 3nBwtAOBGJP5yYtoM9he4cKeDpFbus22FQ9nYa+CuVbOPqa5yLyWusbXQMTRqi+FBiSM /Vsw== 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=OexcqeFKFro9YzL0LA/HRe/mUIr6TjqNNYDzROq9USk=; b=LYYRG/XebsBsHFkElNfVC7QHUoXsQw3uMINMJDXF/Y07MYRY7JV2SFbynAMUg9HXGR DAm7zCJfjsd9SziWU7eW3MXNX3mWPRSdbONh1oQ5xYK0H6P/YVJbZ/cer0WlpvUTLrF3 vv8X1L5j9wpQAe6kiOHRy16vqKjkXNtK0gDLYKE1Dq6/UDZXg8eZ4AM816MOBJjthP2A 6Bk5yNCnnJqZVo8HLF0nI9tBqVdVPSqL7SPuEHgG72DW23ZpW4agV4/hEpxR2g4IpYXp 5zThvSfPeUXrLTQLb8nRA2R7AGMsukqkoUZi6gkug7d2oaTFw52Fs+0tNCIygS2Gih1R EQ+Q== X-Gm-Message-State: AOAM533mWnJUo14SLgKhhqMREGzCVIplP82jHgKiawF5Cb6k9lXKAJZ2 yvrE0x4nGqFtUpPhF5q/vVjEQl/O9VwPwmwLmgAHrw== X-Google-Smtp-Source: ABdhPJwRvSEEv9FtpsS184J7I6cTJX14pj2160M15EU7ek+6qxiVnGzfm0eazPlXVnsCIeyVNE+cybArqvgzcy9EYrY= X-Received: by 2002:a1c:6289:: with SMTP id w131mr25804wmb.64.1594053224574; Mon, 06 Jul 2020 09:33:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 6 Jul 2020 18:33:33 +0200 Message-ID: To: Arnold Daniels Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000345ee205a9c870e2" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Strict operators directive From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000345ee205a9c870e2 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 6, 2020 at 5:27 PM Arnold Daniels wrote: > Hi all, > > I'd like to start the discussion of the "Strict operators directive" RFC > version 1.5. This RFC proposes a new directive strict_operators, which > limits the type juggling done by operators to avoid unexpected results. > > https://wiki.php.net/rfc/strict_operators > > There are some significant changes from the previous version. > strict_operators no longer has cases where it changes the outcome of an > operation. To achieve this the following changes are made to the RFC > > * All comparison operators, besides `===` and `!==`, only accept `int` and > `float` operands. For any other type a `TypeError` is thrown. This includes > `==` and `!=`. > what about DateTime and other objects overwriting comparison operators? (GMP, ...) How would this proposal affect future proposals that expose comparisons to userland (see for example the operator overloading RFC). * The `switch` statement is not affected. > > For frequently asked questions please see > https://wiki.php.net/rfc/strict_operators/faq. > Honestly PHP comparisons are already complex enough, introducing a second set of rules that are just as complex seems like a risky proposal to me. > > [Arnold Daniels - Chat @ Spike]( > https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=l1bam) > [l1bam] --000000000000345ee205a9c870e2--