Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110849 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48835 invoked from network); 6 Jul 2020 17:31:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jul 2020 17:31:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD81C180544 for ; Mon, 6 Jul 2020 09:22:13 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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:22:13 -0700 (PDT) Received: by mail-il1-f172.google.com with SMTP id h16so10073967ilj.11 for ; Mon, 06 Jul 2020 09:22:13 -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=sGAe4pnkXkD7D/6SlQZYBrrAo6KTwVuviawlnGLue7Q=; b=BkqWGrCGKWv3KcqLoFW80fU8/+rSW0ULaG0lzhjZyfq5PB4j7bIBFhdYMB4AVWq7Bw Uuw11Mkxj/k/XAem49v/lAFyZ81Qn8DBxpz/u18KGXAoqdECJKQZtdDqrTnZ9cs41DuE Yj6Utq34gXexOiDOfUz3BSdcXRMPhyfCtP5jC1qGRqiKNDgIzOGMzcRjB9XZHEmFPKlN gua+ZZuqzvm2eP3jGC1OlhQxfU0AdJ2Zg/38wBMcCu1oTfqgAANcmBvXWeFddKUbG9xq OETY0WQy9o4KHpK24V4smHxnTPXemO7yD2w7tLk3zmQ4VltMAzYLrM5RJmEm8YTgK4+2 dFxw== 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=sGAe4pnkXkD7D/6SlQZYBrrAo6KTwVuviawlnGLue7Q=; b=SsS1Mg+lOZC3VYiS6xQAmsdIxuMpQ5zEyL07RqFq9ozw9OeIOVbMROIf28Px1iZWcD 0pRjuElm629pun3uHKhiM+4XIDvDJV3n8F+YMBgvI9/DQBaLHxPO7Zpc9IorynDXMdLv 0QbRs6puDt+sVGWOmbgUAkyl+cK6+BrygyKnhbMyb5pXn8ADBHewiKvxnxcMbulDriQT 3+kGp+sRjo/ql0iJnysHJkUvLT2pYTnTgFiGXNAwuO9Jr6PD6X4Yvjf48CPndkLplMF9 GtqGjuztUuSQ7jtLuXqE+we6QuUfyoKjnlxIoSzQoZOV2rJjzSamSgYT/5kafpsd+CH8 D0Lw== X-Gm-Message-State: AOAM532vW5f7bw4VvOhzv/XcDdp76nsg71I09yNODagjVrbXX2l6fHRl RWdYtswkg7fTu5rEf+5rXjMu80J5xgoOXkKow1Q= X-Google-Smtp-Source: ABdhPJzF258Gn2Hoi7JBDAe9AYnYUbeZqEJPPApVqqLuILZ37QxGHoDTvY1IdK91+TC73tMJCkG1ZStVcZd7E+hZuUQ= X-Received: by 2002:a92:d3c7:: with SMTP id c7mr31479408ilh.292.1594052527452; Mon, 06 Jul 2020 09:22:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 6 Jul 2020 18:21:55 +0200 Message-ID: To: Arnold Daniels Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000a6f84c05a9c84616" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Strict operators directive From: ocramius@gmail.com (Marco Pivetta) --000000000000a6f84c05a9c84616 Content-Type: text/plain; charset="UTF-8" Hey Arnold, Perhaps it makes sense for <=> to still operate with other types, as long as they are uniform? Specifically: * error: 1 <=> "1" * ok: "a" <=> "b" * ok: true <=> false Similar for sorting: I use <=> to differentiate multi-dimensional arrays: perhaps it should error if the array structure differs? The rest of the proposal makes a lot of sense to me. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ 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 `!=`. > * The `switch` statement is not affected. > > For frequently asked questions please see > https://wiki.php.net/rfc/strict_operators/faq. > > [Arnold Daniels - Chat @ Spike]( > https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=l1bam) > [l1bam] --000000000000a6f84c05a9c84616--