Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113713 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75989 invoked from network); 23 Mar 2021 09:44:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Mar 2021 09:44:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ACD3E1804D8 for ; Tue, 23 Mar 2021 02:40:09 -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-Virus: No X-Envelope-From: Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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, 23 Mar 2021 02:40:09 -0700 (PDT) Received: by mail-il1-f178.google.com with SMTP id l5so17543805ilv.9 for ; Tue, 23 Mar 2021 02:40:09 -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=5kSzYfBl8ELUsMVDrc4U1xuyaZTHMYd/Jy6dzk6w3yk=; b=GBeKns9NQymmL/KgyeJ/i5Ed4Hz+9PtcBh7u2sydItQO/CeskK2aCJDrCjnWuuxESR cv4VsnSyrS6fm97sH6KI25i/ui0cKd3aFybKyoGONICq3Qc2jU3Qzd2HmfjFPaond+wv fxg7RBYBRSsp+ciuqaFAjZO4nnyzkQbY/IHbJvei+wChzzngSVzyNu0nAbDzDkwau2l1 M65PEYTyX7y3em7WAf/nsAUFDpz7c+COFwJdt10q6/MhJaQjGuU7jp6CYt8ZJcHYlR/E 8iAT0f2/mR/GhPBqpTTyyTXZqc3inaIxonkyakpMaNNZIaGMIflH+bsIppkBFHgHgX/3 /Heg== 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=5kSzYfBl8ELUsMVDrc4U1xuyaZTHMYd/Jy6dzk6w3yk=; b=S1EKKtbB07KnLSPOLejwSpE9O784AYOusXJUnYJUTpmtgA/zabwUPCuQBy8ofpKVgg e/oyhrzXV4FhlrnRj49BmtoTqAx+cAFyoQOHTj0wo0ebiGAgcPDIxnmRbq4AfxEJzEG2 yCAbmTlGeDVHmyevagy3ICchw5WR3i+Ip0Q7Pe/sPvPJGa3pwbIGNC0AGp2JfdFgG4lV /bzv6PckiHYHlIq/A+NA7s3hNq8KhEpoE4AFEUMuFMuNjGUdcP+MWv4ne0zMKLhUNzQd NC01zM519LrhZzcbB9lduYy4pM9zfWcb3MBWQf8IK77oOMDrJ5Rue11/8gc8upXVFODb ExFQ== X-Gm-Message-State: AOAM531M2tMuae74pVG9fjbunWJFVfyXcMn/1FLH0eHh0xRCUCe5Zem9 hZHwk5PcrVzMq0qsIzQJltJhtAGDorxx5Wz0Hyg= X-Google-Smtp-Source: ABdhPJz7Ad4neMJoJR09tgm/zPzjUSSQFqYczQMveQL7xJXlyEbTmXIZkYKSjyaYSKpg8OIvQaJMBiY3bu6GNdUf4mw= X-Received: by 2002:a92:8752:: with SMTP id d18mr3770529ilm.283.1616492407741; Tue, 23 Mar 2021 02:40:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 23 Mar 2021 10:39:56 +0100 Message-ID: To: "G. P. B." Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000bee21a05be30f733" Subject: Re: [PHP-DEV] [RFC] Pure intersection types From: ocramius@gmail.com (Marco Pivetta) --000000000000bee21a05be30f733 Content-Type: text/plain; charset="UTF-8" Hey George, On Tue, Mar 23, 2021 at 10:32 AM G. P. B. wrote: > Greetings internals, > > I'm presenting a new RFC to add support for pure intersection types to PHP. > > An intersection type A&B means that the value must be of type A and of type > B at the same time. > > I'm calling this proposal pure intersection types as there would be no > possibility of mixing intersection and union types, I'm leaving this as a > future scope. > > The current draft is located on GitHub: > https://github.com/Girgias/intersection-types > And the current implementation PR is: > https://github.com/php/php-src/pull/6799 > > Looking forward to the feedback. > Overall, totally for this, even if it is just the "pure" form that does not yet support composite expressions. I suppose that `ReflectionIntersectionType` will likely be the most interesting part of it, potentially hardcoding `ReflectionIntersectionType#allowsNull()` as `false` for now? (analogous to https://www.php.net/manual/en/class.reflectionuniontype.php ) Greets, Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --000000000000bee21a05be30f733--