Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115537 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60103 invoked from network); 20 Jul 2021 18:10:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jul 2021 18:10:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1C2671804C8 for ; Tue, 20 Jul 2021 11:35:42 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.20]) (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 ; Tue, 20 Jul 2021 11:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1626806139; s=strato-dkim-0002; d=kelunik.com; h=Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:Cc:Date: From:Subject:Sender; bh=0YdR4Y8ul4h7I+Po7q4equGo84Hj36RA/ebCoscz2xY=; b=gDjP+yQrQfkWfWevR6qY2Uy2hJxps9FZHMmUku9dJG+cbXsAQ03J66oT2jJ4XCSjm7 t3QbmcsXD8S/a7VQ5VDgydSMUw57Uxz+X8Sek56QMMN5j7vniCfL4/9XNr7F+aN4ONX1 lqw4aundmorNpoN2MxqWYStqmh479MUL26/rCmOF3R5cKfzMSbuWR8lh6MHka5U9DeK5 7Z56azGj155yLYrPhmWZ2Kp+1A/as5vYafwEDVQWLg83yxH3+KV3XSeLRk2uXey6Dw2t BXOGWlt1IAch//6eF7f1sBsOYNIkLTBc3fh8AtbUZUaYj9OG9HxZPVXKIQxcLtrzdRuS 2VYA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8AaBAcYiRB" X-RZG-CLASS-ID: mo00 Received: from mail-pj1-f53.google.com by smtp.strato.de (RZmta 47.28.1 AUTH) with ESMTPSA id q09bfcx6KIZcOIN (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Tue, 20 Jul 2021 20:35:38 +0200 (CEST) Received: by mail-pj1-f53.google.com with SMTP id jx7-20020a17090b46c7b02901757deaf2c8so152072pjb.0 for ; Tue, 20 Jul 2021 11:35:38 -0700 (PDT) X-Gm-Message-State: AOAM530E7uCR9qWtIoDuofsFn5DKq0OWiwDiL1d+6Btbibqk75dVKfqU 4BGUmd7gQw6hkvMQcZZ6jJCa5KGDaOOi9VQOI3I= X-Google-Smtp-Source: ABdhPJzSvFtku88RPmQd13eSdIY90XqinpDJNZCeXrRPgO3D4wi449p+PSa5eKX25SFsB72/sA/1LiDAm6KUZu5iWjg= X-Received: by 2002:a17:90a:a418:: with SMTP id y24mr33924247pjp.116.1626806137979; Tue, 20 Jul 2021 11:35:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 20 Jul 2021 20:35:26 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: "G. P. B." , Guilliam Xavier , Dan Ackroyd , Nicolas Grekas , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000f9066305c792518c" Subject: Re: [PHP-DEV] intersection types and null for defaults, properties and return types From: me@kelunik.com (Niklas Keller) --000000000000f9066305c792518c Content-Type: text/plain; charset="UTF-8" > > > > > nicolas-grekas wrote on the PR: > > > > > ?X&Y cannot be confused with > > > > > > > > It confused me. A compiler might understand it, but as a human I have > > > > trouble understanding it. > I think ?X&Y would be a pretty poor syntax choice, as it's ambiguous as many others said: (X|null)&(Y) vs. (X&Y)|null. What hasn't been proposed, yet, is ?X&?Y, so requiring either all or none of the types being nullable. Best, Niklas --000000000000f9066305c792518c--