Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115565 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7427 invoked from network); 23 Jul 2021 15:30:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jul 2021 15:30:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF02A1804D0 for ; Fri, 23 Jul 2021 08:56:19 -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_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-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.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 ; Fri, 23 Jul 2021 08:56:19 -0700 (PDT) Received: by mail-yb1-f171.google.com with SMTP id k65so2967747yba.13 for ; Fri, 23 Jul 2021 08:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Qw78fK6W3VjovU9cHLx3WVe7xn3wMf/P/iwKubv1C4=; b=BhegEnQVBjrnsHAMbEueurIP5rRGfOA87c+cQpbVcuO3Evcs6f9LXjTo4ToUSSNxRH 3YtGJka/291PoxtsJf8cz+7lu8O7tR9BQtXf1urmiz51soIaQN9TKOE/MPeMfEqeJvHW DRkiFKHbVn6Njeige4cxzVojIkqT/fGzoeJpA= 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=+Qw78fK6W3VjovU9cHLx3WVe7xn3wMf/P/iwKubv1C4=; b=VNRaRiJbcTcwFPs1vR4dtI8BRmb1N0a0PzE4UFUC4Uqw6WP/LFuYLoW8sEKkPFVn1e Sr/zCplXWiuCKEVF836ikfZUi0anPBLWvnzip9yf/KTAouXmqda9Rwq1KFcT5pIZq0Lc s6/aLcjsmsj9vCWGbga2hofV/cax5MZha1ia7GqJxAz9Qxq/VK9Q99U9omdgRopsq//C yWuxjW8zcIMutlxkCV6jyt4pVVz9G6arz9b7Bwk0MTsUNB+gecmSfDfUdWO3ZvOKYzWf wGh/uaL1CeegD4sohgwZUmuWvnxioRZGgXvU84gmT/cuByFLDAc5BJuUyald8AtFqOJV FRMg== X-Gm-Message-State: AOAM531b4hr4Mm0c2E84Np7PTnYiqZMwU53aTJePLcLkl5gqwedBadMX rqbtncU8b1az0+rKM9OVfGJ5US4vaCB8wameyAfl8Q== X-Google-Smtp-Source: ABdhPJx+wF382WmbRbuLoENajsup6jqLWzccSQjB2WAc88Fhna7fGqCjBXWFTCgtFAE6NoVEZJWzT7sX1GeDHQOt9Vo= X-Received: by 2002:a25:e803:: with SMTP id k3mr7298880ybd.268.1627055777762; Fri, 23 Jul 2021 08:56:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Fri, 23 Jul 2021 09:56:07 -0600 Message-ID: To: Theodore Brown Cc: Nicolas Grekas , PHP Internals List Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: internals@lists.php.net ("Levi Morrison via internals") > As you note in the RFC, PHP already defines `|` as having a lower > precedence than `&`, so `X & Y | null` can only be interpreted as > `(X & Y) | null`. This is consistent with other languages such as > TypeScript, where `A & B | C & D` is parsed as `(A & B) | (C & D)`. > [2] > > Since precedence is already defined for this syntax consistently with > other languages, I don't think it's necessary to require parentheses > if we use the `A & B | null` syntax. I want to acknowledge and reject this. Few people keep the bitwise precedence information in their head. It's not worth it -- just require parenthesis.